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
Suppose we have one azure app service with endpoint production.azurewebsites.net where we have deployed an application and is in production. With the deployment slots feature, we can add another slot which is a full-fledged app service with different end point URL like production-stg.azurewebsites.net.
By default, new slots are given a routing rule of 0% , shown in grey.
Could this be what you're looking for?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With