【发布时间】:2017-06-01 06:52:27
【问题描述】:
我正在尝试通过 powershell 在 Azure 中创建新的 Web 应用服务,但遇到以下错误:
New-AzureRmResourceGroup : 'this.Client.SubscriptionId' cannot be null.
$webAppName = "powershelldemowebapp"
$ResourceGroupName = "PowerShellResourceGroup"
$Location = "East Asia"
Login-AzureRmAccount -ServicePrincipal -Tenant 000000-0000-0000-0000-00000 -Credential $psCred
Get-AzureSubscription
Select-AzureSubscription -SubscriptionId 00000-0000-0000-000-0000
New-AzureRmWebApp -Name $webAppName -ResourceGroupName $ResourceGroupName -Location $Location
【问题讨论】:
-
如果您有多个 ARM 订阅,使用
Select-AzureSubscription您无法更改默认订阅。该 cmdlet 仅更改经典订阅。
标签: powershell azure azure-web-app-service azure-powershell alm