简体   繁体   中英

Azure Powershell script to swap Azure App Service (website) deployment slots

I'm looking for a way to use Azure PowerShell commands to do a deployment swap for an Azure App Service (previously Azure Websites). All of the posts I've seen say to use the command

Move-Deployment -ServiceName

but that appears to only be valid for cloud services and swapping between Production and Staging predefined slots.

I have a website with deployment slots that I've defined and I can use the following command to get information about the website site, but I don't see how to swap it:

Get-AzureWebsite -Name "sitenamehere" -Slot test

这可能是你想要的吗?

Switch-AzureWebsiteSlot [[-Name] <String> ] [[-Slot1] <String> ] [[-Slot2] <String> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

The solution is to use the command

Switch-AzureWebsiteSlot -Name "sitenamehere"

More details are provided in this blog post http://blogs.msdn.com/b/harikharan/archive/2015/01/01/swap-slots-in-azure-web-site-when-there-are-2-or-more-staging-slots-using-azure-powershell.aspx

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