2017-03-09 87 views
0

this link on how to swap slots,與下面的腳本:如何在Azure web應用程序上使用RM Powershell交換插槽?

$ParametersObject = @{ 
    targetSlot = "production"; 
}; 
$Name = "testsite312345345"; 
$SourceSlot = "staging";  

Invoke-AzureRmResourceAction -ResourceType "Microsoft.Web/sites/slots" -ResourceName "$Name/$SourceSlot" -Action slotsswap -Parameters $ParametersObject -ApiVersion 2015-07-01 -Force -Verbose; 

我得到這個輸出,關鍵部分是Property id 'production' at path 'targetSlot' is invalid

VERBOSE:執行操作「調用資源上的‘slotsswap’行動。」在目標上「/subscriptions/xxxxxxxx-7649-4a3e-bc8b-xxxxxxxxxxxx/providers/Microsoft.Web/sites/testsite312345345/slots/staging」。 Invoke-AzureRmResourceAction:管道已停止。 + Invoke-AzureRmResourceAction -ResourceType「Microsoft.Web/sites/slots ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:CloseError::(:) [Invoke -AzureRmResourceAction],PipelineStoppedException + FullyQualifiedErrorId:Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.InvokAzureResourceActionCmdlet

調用-AzureRmResourceAction:LinkedInvalidPropertyId:物業編號 '生產' 的路徑 'targetSlot' 是無效的期待或者資源名稱,如。 'myResource'或合格資源名稱,例如 'myParent/myResource'。

  • Invoke-AzureRmResourceAction -ResourceType「Microsoft.Web/sites/slots ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo:CloseError:( :) [調用-AzureRmResourceAction],ErrorResponseMessageException
    • FullyQualifiedErrorId:LinkedInvalidPropertyId,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.InvokAzureResourceActionCmdlet

我已經嘗試了$TargetSlot生產值的許多格式,但似乎沒有任何工作。

回答

0

你忘了通過資源組名稱:-ResourceGroupName MyRg

沒有從錯誤消息明顯嗎?我知道,我知道,這是壞的;;)

+0

是的我只是執行了一個成功的交換之前回來檢查這個帖子:(。謝謝大衛 – click2install

相關問題