Transform web.config for Azure Website Deployment for each release environment

Dan Cook

In Visual Studio Team Services (was Visual Studio Online), I have three release environments each with an Azure Website Deploy step.

I can transform the web.config for the build step by specifying the "BuildConfiguration" variable (e.g. Uat) which picks up the Web.Uat.config.

However I have multiple release environments that use this build configuration which all need to transform the web config (e.g. Dev,Test,Uat,Live).

Is it possible to specify the the web config transform to use for each release environment before the Azure Website deploy step?

Note: I realise that simple appsettings and connectionstrings can be specified in the Azure Portal under "All Settings" for the website but I need to do much more than transform these simple settings and already have configured the web config transforms for each environment within my solution

Harshil Lodhi

The tokenizer task which comes as a part of Release Management Utility Tasks allows to transform config files depending upon the environment.

A single JSON config file containing all the configuration for all the environments can be used and the task will automatically pick up the right configuration depending upon the environment.

{
  "<environment>": {
    "CustomVariables": {
    "Variable1": "value1",
    "Variable2": "value2",
  },
    "ConfigChanges": [
        {
          "KeyName": "/configuration/appSettings/add[@key='ServiceURL']",
          "Attribute":"value",
          "Value":"https://ServiceURL"
        },
        {
          "KeyName": "/configuration/appSettings/add[@key='EnableDebugging']",
          "Attribute":"value",
          "Value":"false"
        },
        {
          "KeyName":“/configuration/connectionStrings/add[@name='databaseentities']”,
          "Attribute": "connectionString",
          "value": "Integrated Security=True;Persist Security Info=False;Initial Catalog=DB;Data Source=servername"
        }
    ]
}

Like this you can have many environments and their configuration in a single JSON file and the tokenizer task will modify your config depending upon the environment on which the deployment is going on.

Read the details on the above link to know more.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Missing Documentation for web.config for a Node.js application on Azure Website

From Dev

Transform app.config for 3 different environment

From Dev

How to force a clean Azure WebSite deployment

From Dev

How to specify different FTP user in deployment credentials for each Azure Website?

From Dev

Trying to configure SMTP correctly in Web.config for Azure Website. Cannot get to work

From Dev

Web.config transformation during Azure Website deployment from source control

From Dev

Why am I receiving the required attribute 'name' is missing warning in my Web.Release.config XML-Document-Transform file?

From Dev

Custom domain name for azure website deployment slot?

From Dev

Transform web.config on azure

From Dev

azure website rewrite rule in web.config to redirect .net to .com

From Dev

Web config transform for custom section

From Dev

How can I use a different web.config file for each Azure deployment slot?

From Dev

Specify which config transform to use for continuous deployment to Azure web app

From Dev

Release Management Azure Website

From Dev

Web Config changes for deployment slots in Azure

From Dev

Confused on what is the correct procedure on storing passwords in Web.config for Azure deployment

From Dev

Update Web.config configuration with powershell on Azure Release Script

From Dev

Nuget renaming web.config to web.config.transform

From Dev

Web.config variable update not working with Azure DevOps pipeline (File Transform)

From Dev

Azure Web Deployment Fails - Website with given name already exists

From Dev

Web.config variable update not working with Azure DevOps pipeline (File Transform)

From Dev

Azure Web Role Deployment

From Dev

Unable to transform web.config

From Dev

Missing Documentation for web.config for a Node.js application on Azure Website

From Dev

How to specify different FTP user in deployment credentials for each Azure Website?

From Dev

Error on website deployment to Azure keystone.js

From Dev

Azure website does not have web.config file

From Dev

Environment-specific configuration in app/web.config when implementing continuous deployment

From Dev

Environment Variables in web.config

Related Related

  1. 1

    Missing Documentation for web.config for a Node.js application on Azure Website

  2. 2

    Transform app.config for 3 different environment

  3. 3

    How to force a clean Azure WebSite deployment

  4. 4

    How to specify different FTP user in deployment credentials for each Azure Website?

  5. 5

    Trying to configure SMTP correctly in Web.config for Azure Website. Cannot get to work

  6. 6

    Web.config transformation during Azure Website deployment from source control

  7. 7

    Why am I receiving the required attribute 'name' is missing warning in my Web.Release.config XML-Document-Transform file?

  8. 8

    Custom domain name for azure website deployment slot?

  9. 9

    Transform web.config on azure

  10. 10

    azure website rewrite rule in web.config to redirect .net to .com

  11. 11

    Web config transform for custom section

  12. 12

    How can I use a different web.config file for each Azure deployment slot?

  13. 13

    Specify which config transform to use for continuous deployment to Azure web app

  14. 14

    Release Management Azure Website

  15. 15

    Web Config changes for deployment slots in Azure

  16. 16

    Confused on what is the correct procedure on storing passwords in Web.config for Azure deployment

  17. 17

    Update Web.config configuration with powershell on Azure Release Script

  18. 18

    Nuget renaming web.config to web.config.transform

  19. 19

    Web.config variable update not working with Azure DevOps pipeline (File Transform)

  20. 20

    Azure Web Deployment Fails - Website with given name already exists

  21. 21

    Web.config variable update not working with Azure DevOps pipeline (File Transform)

  22. 22

    Azure Web Role Deployment

  23. 23

    Unable to transform web.config

  24. 24

    Missing Documentation for web.config for a Node.js application on Azure Website

  25. 25

    How to specify different FTP user in deployment credentials for each Azure Website?

  26. 26

    Error on website deployment to Azure keystone.js

  27. 27

    Azure website does not have web.config file

  28. 28

    Environment-specific configuration in app/web.config when implementing continuous deployment

  29. 29

    Environment Variables in web.config

HotTag

Archive