Paolo B
Paolo B

Reputation: 3354

Deploy multiple .Net Core Web projects in same solution to multiple Azure App services

As per the title, we have multiple .Net Core Web application projects in a single solution. In order to deploy these we have to right-click publish on each project and the warm up the sites manually.

I would like to automate this process and assume I can do this via e.g. scripting in powershell? However, I wondered if there would be a way to do this via visual studio configuration, or is the scripting methods preferable in this situation?

I'm not sure where to start with this automation process, searches have not turned up any similar results.

Upvotes: 0

Views: 1259

Answers (1)

Tom Sun
Tom Sun

Reputation: 24529

would like to automate this process and assume I can do this via e.g. scripting in powershell?

Please have a try to use the following code, I test it on my side, it works correctly. More details about Publish-AzureWebsiteProject please refer to the document.

Add-AzureAccount

$websitesName = @('WebAppName1','WebAppName2') # website name
foreach ($name in $websitesName)
{
  Publish-AzureWebsiteProject -Name $name -Package  'C:\Tom\netcoreApp.zip'  # package
}

enter image description here

How to get the zip file, I test it with Visual Studio 2017.

enter image description here

enter image description here

Upvotes: 1

Related Questions