1
votes

I'm adding this in the hope that it saves other people wasting time like I just have. I can't currently explain why this has changed, but I can supply the resolution that's worked for me.

TL;DR: You no longer need to specify the production slot when using Switch-AzureRmWebAppSlot, only supply -SourceSlot with the name of the slot you want to switch with your production slot.

Error:

Switch-AzureRmWebAppSlot : The Resource 'Microsoft.Web/sites/SiteName/slots/production' under resource group 'ResourceGroupName' was not found. At line:1 char:1 + Switch-AzureRmWebAppSlot -SourceSlotName $SourceSlot -DestinationSlot ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Switch-AzureRmWebAppSlot], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.SwitchAzureWebAppSlot

1

1 Answers

2
votes

Old working code:

Switch-AzureRmWebAppSlot -SourceSlotName 'production' -DestinationSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'

New working code:

Switch-AzureRmWebAppSlot -SourceSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'