10
votes

I have a .NET solution that contains several projects. I want to set up a deployment pipeline in Azure DevOps but I'm not sure how to do this. I want to have 1 pipeline that deploys the following projects:

  • Main web app -> needs to go to Azure Web Apps
  • Portal web app -> also needs to go to Azure Web Apps
  • Database -> needs to be deployed to SQL Azure Database

How do I set this up? I selected the default 'Azure App Service Deploy' template, but in the deployment task I cannot select which project I want to deploy. The package refers to $(build.artifactstagingdirectory)/**/*.zip, but this is a zip file that contains the artifacts for both my web projects (and the database DACPAC is missing here).

2
Have you figured this out? I too am having the same issue/question.RoLYroLLs

2 Answers

2
votes

that's many questions in one, but I'd generally separate build\release pipelines for each application (that way you have more control) and you dont have the problem of how to select proper zip file. I'm pretty sure you cant even select a part of zip file (since you now have a single zip file with several solutions), so your approach is not going to work.

as for how to set this up: your build should build 1 project exactly and pack\upload it. and then your release will target that artifact and everything will work just fine.

1
votes

First things first. Copy the build artefacts into 3 different packages. Say,

  • Artefacts1: For Web Apps

  • Artefacts2: For Portal Apps

  • Artefacts3: For DACPAC files

In this case you will have 3 copy files task copying and 3 publish build artefacts task to publish it to Azure DevOps. In the release pipeline, add 3 agent jobs to perform

  • Deploy to Web App
  • Deploy to Portal App
  • Database DACPAC Deploy

You can refer this to have similar pipeline.