Azure Continuous Deployment with multiple projects

大憨熊 提交于 2019-12-21 04:03:29

问题


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.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/34849945/azure-continuous-deployment-with-multiple-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!