简体   繁体   中英

Script to configure continuous deployment for an Azure Web App (Web Site)

Using the Azure portal I have successfully configured Azure's Continuous Deployment for an Azure Web App (Web Site) from a GitHub or BitBucket repository.

Is it possible to automate the process with a PowerShell script? If required I'll use a REST endpoint. My googling for a solution has lead me nowhere.

This PowerShell just worked fine for my continuous deployment web site.

Import-Module azure*
Login-AzureRmAccount
$MyResourceGroup = 'myresourcegroupname'
$MyResourceName = 'myresourcename'
Invoke-AzureRmResourceAction -ResourceGroupName $MyResourceGroup -ResourceType Microsoft.Web/sites -ResourceName $MyResourceName -Action sync -ApiVersion 2015-08-01 -Force -Verbose

Thanks to this answer: https://stackoverflow.com/a/36501283/2805509

I'm sure this can be automated using PowerShell. What CI tool do you use?

I am using TeamCity and you can configure it to pull the source codes from your github or any other source control systems and then automate the deployment process using PowerShell. Work like a charm for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM