2017-02-21 15 views
0

私は西ヨーロッパの地域で、国家の雲の環境AzureGermanCloudでVMを停止するためのpowershell runbookを作成しようとしています。私はポータルからそれをテストしたときにここに私のPowerShellコンソールから認証国家の雲の環境のための自動化のランブム

$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 

のためのコードは、それが言うに動作していること:

追加-AzureRmAccount:「をAzureGermanCloud」

名前を持つ環境を見つけることができません。

他の環境からのナショナルクラウド環境へのアクセスには制限がありますか、それとも何か不足していますか? the docsによると

おかげで、

PGR

答えて

0

は、唯一の有効な値は、 "AzureCloud" と "AzureChinaCloud" です。

Set-AzureRmEnvironmentコマンドレットを使用して環境を "AzureGermanCloud"として定義し、これまでのように-EnvironmentNameを使用して指定する必要があります。

関連する問題