2017-02-21 80 views
0

我想創建在西歐地區一個PowerShell運行手冊在全國雲環境AzureGermanCloud停止虛擬機自動化運行手冊。這裏的認證國家雲環境

$Cred = Get-AutomationPSCredential -Name $CredentialAssetName 
if(!$Cred) { 
    Throw "Could not find an Automation Credential Asset named '${CredentialAssetName}'. Make sure you have created one in this Automation Account." 
} 

#Get the Azure environment with the above name from the Automation Asset store 
$Env = Get-AutomationVariable -Name $AzureEnvironmentName 
if(!$Env) { 
    Throw "Could not find an Azure environment '${AzureEnvironmentName}'." 
} 

$Account = Add-AzureRmAccount -Credential $Cred -EnvironmentName $Env 

從我的PowerShell控制檯的代碼作品,但是當我從門戶測試它,它說:

添加-AzureRmAccount:無法找到名爲「AzureGermanCloud」

環境

從其他環境訪問國家雲環境是否有任何限制?或者我錯過了某些東西?

感謝,

PGR

回答

0

根據the docs唯一有效的值是 「AzureCloud」 和 「AzureChinaCloud」。

您需要使用Set-AzureRmEnvironment cmdlet將環境定義爲「AzureGermanCloud」,然後像以前一樣使用-EnvironmentName來指定它。