In my last blog post, I showed how you can use ASP. The next step is to enable CI/CD for it, since you really shouldn’t be using “Publish” within Visual Studio for deployment.
As part of this, I wanted to configure the Cloud Service settings per environment in VSTS and not have any configuration checked-in to source control.
Then, we’ll create a release management process that takes the output of the build and deploys it to the cloud service in Azure.
To handle the configuration, we’ll tokenize the checked-in configuration, then use a release management task to read configuration values stored in Key Vault and replace the matching tokenized values before the Azure deployment. You should have one Key Vault per environment that you intend to release to, since the secret names will directly translate to variables within VSTS.
While the idea was technically sound, it did mean that binding redirects were required for all . We heard the feedback loud and clear that this was really painful and took steps to fix it in 4.0.
The fix was to consolidate the previous set of packages into a single package. Since then, the tooling has changed significantly with Visual Studio 2017 and Visual Studio for Mac. You can also do it by hand (which is what I did for my projects).
At this point, when you reload the project, it should restore the packages and build correctly. I created a sample solution showing this all working over on Git Hub. This blog will explore why you might want to do this, how to do it and workarounds for some point-in-time issues with the tooling.
For each setting you need, create a secret with name like will have the certificates’ SHA-1 thumbprint’s encoded in them.
If you want to configure this per environment, then replace those with token values.
The solution presented here handles deployment of an MVC & API application that along with config settings and deployment of the ASP. VS Cloud Service tooling works for making changes to config and publishing to cloud services (though please use CI/CD in VSTS! Installing additional components onto a Web Role typically involves a startup script, and . There is one complication though: the installer downloads files into the Now we finally have a cloud service that can be deployed, install . The first time you publish, it will take a few minutes for the role instance to become available since it has to install the hosting module and restart IIS. NET Core website to have any awareness of Cloud Services, so I came up with another way—in the startup script, I copy the values from the You can now use SDK-style projects, with all supported TFM’s, in Visual Studio for Mac. While Visual Studio for Mac supports the SDK-style projects, there have been a couple of issues blocking use of TFM’s other than I am happy to announce that the first preview of Rx. This release addresses a number of issues and contains several enhancements.
)Many thanks to Scott Hunter‘s team, Jaques Eloff and Catherine Wang in particular, on figuring out a workaround for some gotcha’s when installing the Windows Hosting Module. There are many ways of getting configuration into an ASP. If you know you’ll only be running in Cloud Services, you may consider taking a direct dependency on the Cloud Services libraries and using the configuration into the ASP. The biggest enhancement is consolidating the existing packages into one main package, Nu Get.