In the Azure Portal I'm able to specify the host operating system when creating a Web App. How can I achieve the same via Powershell? I' looked into the docs of the New-AzureRmWebApp and New-AzureRmAppServicePlan cmdlets but wasn't able to find any references on how to pass the OS as parameter. I also tried via the Azure CLI 2.0 on Ubuntu without success.
Asked
Active
Viewed 973 times
1 Answers
3
Try the command below, it works fine on my side, it creates a Linux Service Plan and a Linux web app in it.
New-AzureRmResource -ResourceGroupName <ResourceGroupName> -Location <Location> -ResourceType microsoft.web/serverfarms -ResourceName <YourPlanName> -kind linux -Properties @{reserved="true"} -Sku @{name="S1";tier="Standard"; size="S1"; family="S"; capacity="1"} -Force
New-AzureRmWebApp -ResourceGroupName <ResourceGroupName> -Name <YourAppName> -AppServicePlan <YourPlanName>
Check it in the Azure Resource Explorer.

Joy Wang
- 39,905
- 3
- 30
- 54
-
At first when I tried this I got the following error: https://pastebin.com/3ffdbxXU. But then when I tried another region (Central US) it worked just fine. It's just weird that there's no way to create a Linux App Service Plan via the New-AzureRmAppServicePlan cmdlet. Thank you! – adamasan Jul 16 '18 at 03:28