I'm using VSTS 2017 Release Management with a build-once-deploy-many-strategy. My project is a dotnet core-webproject. First I restore/build/test/publish my project with dotnet
and then I publish my artifact (a zip).
Now I want to deploy this build with different configurations to different environments. With "regular" dotnet I used WinRM Web App Management together with a parameters.xml to add my environment-specific configuration. As example below:
But my package created with dotnet publish
is a zip and not a msdeploy-package.
How do I replace the configurations (appsettings.json)?
How can I deploy it to my IIS?
What I've already tried:
First I ran dotnet publish
but without the Zip Published Projects-option. This made it possible to easily make my changes i appsettings.json
, but instead required me to use a Copy file-operation to do my deploy. This had the downside of IIS locking the files, which in turn required me to write PS-scripts which took IIS offline/online.
I just want to create a package, which can be deployed to several environments and with different configurations. How can I achieve it?