我正在尝试在西欧地区创建一个 powershell 运行手册,用于在国家云环境 AzureGermanCloud 中停止 VM。这是身份验证的代码
$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 控制台可以工作,但是当我从门户网站测试它时,它说:
Add-AzureRmAccount:找不到名称为“AzureGermanCloud”的环境
从其他环境访问国家云环境是否有任何限制......或者我可能遗漏了什么?
谢谢,
PGR