I'm trying to create a new web app service in Azure from powershell, but running into the following error:
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
and Select-AzureSubscription
are ASM cmdlets. I notice that you want to create a ARM webapp. If you have multiple ARM subscriptions, using Select-AzureSubscription
you could not change the default subscription. The cmdlet only change classic subscriptions.
You need use ARM cmdlets.
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionId 00000-0000-0000-000-0000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With