我想从订阅A执行操作手册,这将在订阅B上创建存储空间。我在凭证资产中提供了订阅B的(用户名/密码)。无法通过Azure自动登录Azure订阅
首先,请让我知道是否有可能这样做?
当我尝试运行下面的代码,它提供了一个错误“无法获取租户‘通用’令牌”当我运行Get-AzureRmSubscription
$CredentialAssetName = "login";
$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."
}
add-azurermaccount -credential $Cred
login-AzureRMAccount -Credential $Cred
Select-AzureRmSubscription -SubscriptionName 'Free Trial'
get-azurermsubscription
可以通过Azure Runbook创建另一个订阅中的存储账户, –