Switch-AzureRmWebAppSlot no longer supports Produc

2019-07-26 08:45发布

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条回答
smile是对你的礼貌
2楼-- · 2019-07-26 09:14

Old working code:

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

New working code:

Switch-AzureRmWebAppSlot -SourceSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'
查看更多
登录 后发表回答