我尝试通过 powershell 在 Azure 中创建新的 Web 应用服务,但遇到以下错误:
New-AzureRmResourceGroup:“this.Client.SubscriptionId”不能为空。
$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 Web 应用程序。如果您有多个 ARM 订阅,则使用 Select-AzureSubscription
无法更改默认订阅。该 cmdlet 仅更改经典订阅。
您需要使用 ARM cmdlet。
获取 AzureRmSubscription
选择-AzureRmSubscription -SubscriptionId 00000-0000-0000-000-0000
关于powershell - 新-AzureRmResourceGroup : 'this.Client.SubscriptionId' cannot be null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41693243/