Search code examples
azureazure-devopsazure-web-app-serviceazure-deployment

Setting the environment for XML transformation in an Azure App Service Deploy task


I'm using an Azure DevOps Pipeline to release an ASP.NET MVC system to an Azure Web App.

I've configured the build not to apply the XML transforms, so I can apply them later, during the release step, and the same build artefact can be released to multiple environments.

The build works fine, and I end up with an artefact containing an untransformed web.config, and the environment-specific transform files.

The Azure App Service Deploy task has a check-box called XML Transformation, which displays the following help text:

The config transforms will be run for *.Release.config and *.<EnvironmentName>.config on the *.config file. Config transforms will be run prior to the Variable Substitution. XML transformations are supported only for Windows platform.

At the moment I'm trying to set up a release into a test environment, but the Web.Release.config is being applied, rather than the Web.Test.config. I've searched everywhere I can find for a place to define the environment to make the release use the test config, but I can't find anywhere.

There's a similar question on GitHub which shows the following screenshot:

Environment Option

Unfortunately mine doesn't look like that:

enter image description here

Am I trying to do the right thing? If so, where do I set the environment?


Solution

  • You need to make sure your stage name is just 'Test' and not 'Deploy EMS to Test', reference here.