Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Continuous Deployment with multiple projects

I have found a few questions (this one, this one, and this one) related to this question, however none of them clearly answer my question: Do I really need TFS or VSO in order to achieve this?

What I have is: A solution with two projects: demo.Web and demo.Api.

In Azure I have demo-web.azurewebsites.net (with demo-web-staging.azurewebsites.net) and demo-api.azurewebsites.net (with demo-api-staging.azurewebsites.net).

I have the whole solution (with both projects each containing the correct publish profiles pointing to the correct deployment slot in azure) pushed to a git repo.

How could I tell demo.Web, go to demo-web-staging.azure... and demo.Api, go to demo-api-staging.azure...? Is the only way through TFS? I just cannot find any tutorials with multiple web apps on google.

Thanks.

like image 853
WPalombini Avatar asked Jan 18 '16 08:01

WPalombini


People also ask

Can we create multiple projects in Azure DevOps?

You can have up to 1000 projects within an organization in Azure DevOps. The following diagram shows one project and team versus multiple projects and teams in an organization or collection.

Can Azure DevOps project have multiple repos?

Specify multiple repositories Only Azure Repos Git ( git ) repositories in the same organization as the pipeline are supported for multi-repo checkout in Azure DevOps Server 2020.

How many projects we can create in Azure DevOps?

Azure DevOps Services limits each organization to 1000 projects per organization, an increase over the previous limit of 300 projects.

Can a azure pipeline have multiple triggers?

Yes, you can have multiple . yml files with any name really. When you create the build pipeline, you pick and reference the existing yaml.


1 Answers

The answer is quite simple. Just bind the two Web Apps (one for the demo.Web and the other for demo.Api) to the same repo. Then, go to each other's Settings blade in the Azure Portal and look for Application Settings.

On the App Settings subsection, add a setting called "Project" whose value is the path to the .csproj that you want to build, relative to the repo's root folder.

App Settings snapshot

On the first Web App it will point to the demo.Web project file, and on the second Web App, it will point to the demo.Api project file.

You don't need TFS to achieve it.

EDIT: For ASPNET5/MVC6 projects, just add the path to the "project.json" folder you want to deploy, you don't need to add the .xproj to the path.

like image 189
Matias Quaranta Avatar answered Oct 10 '22 21:10

Matias Quaranta