Azure DevOps XML Transformation During Release Not Working

前端 未结 4 681
北荒
北荒 2020-12-17 01:29

I want to configure our pipeline to allow one build to be used for multiple environments without having to create separate builds. According to the docs, it seems like it is

4条回答
  •  清歌不尽
    2020-12-17 02:17

    I just got this working so I could have one build with deployment to multiple environments. This is what I did.

    In the code, I set each Web..config property to Build Action = "Content". I also set all mine to Copy to Output Directory = "Copy Always". I also unloaded the project and edit the csproj file, then removed the Web.config lines. This dumps all your web.configs to the root (no file nesting).

    In the build, I set pipeline variable BuildConfiguration = "Release". I don't have a Web.Release.config in my project.

    In the release, I named the deployment stage after the environment (in my case, Development, Staging, and Production). In all stages, on the Azure deployment task, I checked the XML transform checkbox.

    In Azure, I set the ASPNETCORE_ENVIRONMENT to the naming of the staging environment, in my case, Development, Staging, and Production).

提交回复
热议问题