Switch-AzureRmWebAppSlot no longer supports Production slot name

て烟熏妆下的殇ゞ 提交于 2019-12-11 08:36:52

问题


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:


Old working code:

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

New working code:

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


来源:https://stackoverflow.com/questions/49558465/switch-azurermwebappslot-no-longer-supports-production-slot-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!