Wanting to deploy a collection of .NET Core API's (microservices) using Azure DevOps I run into some challenges:

  1. Having 10+ small API's, how should I setup the Release Pipeline? One pipeline with one "stage" for each API/application? Or a separate Pipeline for each API?

  2. The API's are deployed to IIS on Windows Server. I'm using the FTP Task now but it's really cumbersome as the AppPool needs to be stopped, then the code is copied over, then the AppPool is started again. I know (non-disruptive) deployment on Azure with App Service is way easier with deployment slots, etc. but what tools can I use on a plain VPS with IIS on Windows Server?

  3. How can I transform or inject the correct appsettings.json values for each environment during Release using Azure DevOps? I could use Pipeline variables but they seem to be shared across the whole Pipeline, so I would need a separate Pipeline for each API then (see question 1). There's the task "Magic Chunks" but it doesn't handle arrays well (which is widely used for Serilog for example). Environment variables on the target machine would be an option, but the API's are deployed to IIS so how can I separate the environment variables per API (there could be the same keys with different values for multiple API's)?

  1. I use separate pipeline for each app
  2. you could use powershell task to restart IIS, but I dont think there is a way to do this without shutting down the website. You can also reconfigure website, so copy new code to location X, repoint website to location X, restart website. Then you can easily point it back if something fails and switch is almost instanteneous
  3. You can use library variable sets (or groups, dont remember). those can be tied to the stage in the release. it might also be possible to scope regular variables, but I've never tested that.
  1. Depends on whether or not these small APIs change together or separately (meaning you may have code changes for only 1 API and be able to deploy it distinctly vs. deploy it all together). If you may have distinct deploy needs, set up separate pipelines.

  2. There are extensions specifically for deploying IIS applications that give you all of the features necessary to properly deploy these sites and control other aspects of IIS.

  3. There are plenty of extensions and built-in features for transforming configuration files or modifying them using variables from within your pipeline. In addition, each environment can have specific variables so that you can configure the same named variable, but change its value per environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.