3

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.

adamasan
  • 1,092
  • 1
  • 12
  • 33

1 Answers1

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>

enter image description here

Check it in the Azure Resource Explorer.

![enter image description here

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