Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy multiple apps with Azure DevOps?

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).

like image 908
Leon Cullens Avatar asked Feb 08 '19 16:02

Leon Cullens


People also ask

Can we deploy multiple applications in app service?

Yes, the setup is very much possible and is a common requirement. You can deploy multiple separate 'WebApps' under an 'App Service Plan'. All those WebApps (/websites) will have their own separate default domain (FQDN) and also you can set custom domain for each of those WebApps.


2 Answers

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.

like image 120
4c74356b41 Avatar answered Oct 23 '22 13:10

4c74356b41


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.

like image 25
Srivatsa Marichi Avatar answered Oct 23 '22 13:10

Srivatsa Marichi