0

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

6 Comments

@PaoloB If it is useful, please mark it as answer that will more communities who have the same issue.
But how deploy multiple websites in same solution and warm them up?
how deploy multiple websites in same solution On my option, we could package the each website in the solution and use loop to do that. Publish-AzureWebsiteProject -Name $name -Package $packagePath
OK, I tried your approach but got issues I think to do with AppSettings.json but have not had time to look in to it since.
Could you please share more info about gotten issue?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.