Jeff Treuting
Jeff Treuting

Reputation: 13510

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

Upvotes: 20

Views: 4474

Answers (2)

StegMan
StegMan

Reputation: 531

Could this be what you're looking for?

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

Upvotes: 23

Jeff Treuting
Jeff Treuting

Reputation: 13510

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

Upvotes: 2

Related Questions