2017-02-21 99 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来指定它。