Reputation: 117
We're gearing up to use DevOps for our CI/CD process involving ASP.Net web applications, and I'm having trouble getting to "best practice" for the web.config transform step.
The documentation and examples point to putting the transform task in the Release pipeline. In order to do that, though, the Web.Debug/Release/Staging.config (and others) have to be available from the artifacts, which means we have to change the Build Action to Content, which means they wind up as part of the deployed code.
If we do the transform in the Build pipeline, on the other hand, we can keep the transform files out of the deployed code. In this case, though, we have to have discrete builds for each release target, which means our Staging and Production builds will not be bit-identical.
I am certain I'm missing something... but it's been hard to chase down the best practices. I very much appreciate any guidance or thoughts.
Upvotes: 2
Views: 287
Reputation: 9208
You don't have to include the web.config file(s) in the build artefact; the Release pipeline can read them from source code for itself.
Consider the broad process like this:
Upvotes: 1