How do I use Powershell to create an Azure Web App that runs on Linux?

放肆的年华 提交于 2020-12-11 12:13:38

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/51353318/how-do-i-use-powershell-to-create-an-azure-web-app-that-runs-on-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!