Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy to Azure App Service with PowerShell?

I have looked around and with the thousands of commands in the Azure and AzureRM commandlets in PowerShell, I'm still not sure how to do this.

What I have working so far:

  • Installed Azure and AzureRM modules and imported them to the script
  • Generated the "*.publishsettings" file from the get-AzurePublishSettingsFile command
  • Imported the "*.publishsettings" file
  • Can acccess the website with the "Stop-AzureWebsite" and "Start-AzureWebsite" commandlets

What I need to do:

  • create a new deployment and push files to the app-service site.

Notes: I do not have a Visual Studio project and .csproj file configs. I simply want to take the contents of a folder and push that to the website.

Any help would be useful as the documentation is really bad on details and there are thousands of commands in PowerShell to go through.

like image 375
IronWilliamCash Avatar asked Aug 23 '17 21:08

IronWilliamCash


1 Answers

You could check this blog:Deploy an App Service using Azure PowerShell to a Deployment Slot.

Get-AzurePublishSettingsFile
Import-AzurePublishSettingsFile .\Your-Publish-Settings-credentials.publishsettings
Get-AzureSubscription
Select-AzureSubscription -SubscriptionName "The Subscription Name containing the slot"
Set-AzureSubscription -SubscriptionId "ID of subscription"

$WebAppName = "standard(staging)"
Get-AzureWebsite -Name $WebAppName
Publish-AzureWebsiteProject -Name $WebAppName -Package "C:\PowerShell\standard.zip" -Slot "staging"
like image 86
Shui shengbao Avatar answered Nov 15 '22 05:11

Shui shengbao