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