我正在尝试从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
最佳答案
Get-AzureSubscription
和Select-AzureSubscription
是ASM cmdlet。我注意到您想创建一个ARM webapp。如果您具有多个ARM订阅,则无法使用Select-AzureSubscription
更改默认订阅。该cmdlet仅更改经典订阅。
您需要使用ARM cmdlet。Get-AzureRmSubscriptionSelect-AzureRmSubscription -SubscriptionId 00000-0000-0000-000-0000
关于powershell - New-AzureRmResourceGroup: 'this.Client.SubscriptionId'不能为null,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41693243/