Switch-AzureRmWebAppSlot不再支持生产插槽名称 [英] Switch-AzureRmWebAppSlot no longer supports Production slot name
问题描述
我添加此内容是希望它可以节省其他人像我一样浪费的时间.我目前无法解释为什么发生了变化,但是我可以提供对我有用的分辨率.
TL; DR::在使用Switch-AzureRmWebAppSlot时,您不再需要指定生产插槽,只需提供-SourceSlot并提供您要与生产插槽一起切换的插槽的名称.>
错误:
Switch-AzureRmWebAppSlot:未找到资源组" ResourceGroupName "下的资源"Microsoft.Web/sites/ SiteName /slots/production". 在第1行:char:1 + Switch-AzureRmWebAppSlot -SourceSlotName $ SourceSlot -DestinationSlot ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:CloseError :( :) [Switch-AzureRmWebAppSlot],CloudException + FullyQualifiedErrorId:Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.SwitchAzureWebAppSlot
旧的工作代码:
Switch-AzureRmWebAppSlot -SourceSlotName 'production' -DestinationSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'
新的工作代码:
Switch-AzureRmWebAppSlot -SourceSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'
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
Old working code:
Switch-AzureRmWebAppSlot -SourceSlotName 'production' -DestinationSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'
New working code:
Switch-AzureRmWebAppSlot -SourceSlotName 'staging' -ResourceGroupName 'ResourceGroup' -Name 'webapp'
这篇关于Switch-AzureRmWebAppSlot不再支持生产插槽名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!