How to deploy a solution with two projects to Azure App Service?

前端 未结 1 1047
不知归路
不知归路 2021-02-05 22:43

I am trying to minimize the cost of running my web app in Azure App Service. I have a Visual Studio 2017 solution with two Web Projects: Web and API (both .NET Core). The entire

相关标签:
1条回答
  • 2021-02-05 23:00

    An Azure App Service Plan can contain multiple web apps. Normally when you use the Azure portal to connect it to source control, Kudu (the tool behind App Service Plans), will create a deployment script for that site.

    In case you want to deploy two projects of a single solution (and git repo) to different Web Apps you have to do the following:

    • Create two web apps under the same App Service Plan
    • Connect both of them to the same git repo for automated deployments
    • Modify the deployment parameters

    I'm going to suppose you know how to do the first two steps.

    To modify the deployment parameters, you could either modify the deployment script by downloading it through Kudu and adapting it or, much simpler, configure it through the portal:

    • Go the App1 => Application Settings => Add setting PROJECT with value <path>\<path-to-app1>.csproj
    • Go the App2 => Application Settings => Add setting PROJECT with value <path>\<path-to-app2>.csproj

    Every time you push up a change, both web apps will receive an update, but they will deploy a different part to the web site.

    More information can be found here (see last paragraph): https://github.com/projectkudu/kudu/wiki/Customizing-deployments

    0 讨论(0)
提交回复
热议问题