【问题标题】:How to use Azure Powershell to change the stack of an Azure WebApp?如何使用 Azure Powershell 更改 Azure WebApp 的堆栈?
【发布时间】:2020-03-28 22:57:28
【问题描述】:

有人知道如何更改 Azure WebApp 的堆栈吗?例如,当使用 New-AzWebApp 创建 web 应用程序时,默认堆栈是 .NET 4.0。如何在不必恢复使用门户的情况下将其切换到 DOTNETCORE? 另外,如何在不借助资源模板的情况下在创建时指定堆栈?

【问题讨论】:

  • 您好,能解决您的问题吗?

标签: azure powershell web-applications azure-web-app-service


【解决方案1】:

据我所知,如果您使用New-AzWebApp,则无法在创建时指定堆栈,但您可以在创建后使用以下命令将其切换为dotnetcore。

New-AzWebApp -ResourceGroupName <Resource-Group-Name> -Name <web-app-name> -Location centralus -AppServicePlan <app-service-plan-name>
$PropertiesObject = @{
        "CURRENT_STACK" =  "dotnetcore"
    }
New-AzResource -PropertyObject $PropertiesObject -ResourceGroupName <ResourceGroupName> -ResourceType Microsoft.Web/sites/config -ResourceName "<web-app-name>/metadata" -ApiVersion 2018-02-01 -Force

登录门户:

【讨论】:

  • 有没有办法在这里设置版本?现在我们有 NET Core 3.1、NET .5 等。
猜你喜欢
  • 2016-05-06
  • 1970-01-01
  • 2021-05-27
  • 1970-01-01
  • 1970-01-01
  • 2016-05-22
  • 2014-11-23
  • 2019-04-06
  • 1970-01-01
相关资源
最近更新 更多