Config file data changes during runtime in RM


In the real business scenario, it is always the requirement that every environment (QA, Stag, Prod etc) have its specific data mentioned in the different config files. As an example, the most common requirement is that every environment have its own database connection information in the config file.

Now the question is, how to get it changed/updated when release will go to the particular stage?

Here are the steps that can help us implementing it :-

  1. In the Release Management Client, go to the tabs – Configure Apps > Component and select the required component: image
  2. Double click the selected component. It will open it. Select the tab “Configuration Variables”. Add the variable by clicking the Add button. Select the required Variable replacement mode from the dropdown list. Finally select the File Extension filter which will be considered for replacing the added variable. Here in this example, I have taken web.config and so File Extension filter will be *.config. image
  3. In the release template, add the above changed component and set the appropriate value for the variable. Copy the component into all the configured environments and change the value of the variable accordingly. image
  4. Save and close it.
  5. Finally go to the visual studio and edit web.config and add variable in it with two underbars both at start and at the end. Example, in our case, we added username=__USERNAME__image
  6. Trigger the release and it will replace the value of __USERNAME__ with the one defined in the components in RM for the respective environment.

–End of Article–

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s