在cmdlet Set-AzWeAppSlot中,NetFrameworkVersion的值是什么?

问题描述 投票:0回答:1

我正在Powershell中使用Set-AzWeAppSlot在AppService插槽上设置一些配置选项。

此cmdlet中的一个选项是-NetFrameworkVersion。

我想将其设置为.NET Core。但是文档并没有提供有关可以指定的值的任何线索。

我看过一个ARM模板,它带有“ dotnetcore”,所以我尝试了一下,但得到了:

 Set-AzWebAppSlot: Operation returned an invalid status code 'BadRequest'

任何想法我需要为.NET Core使用什么值?

azure powershell azure-web-sites
1个回答
0
投票

Set-AzWebAppSlot没有内置参数来设置.NET Core,请尝试以下操作:

$PropertiesObject = @{
        "CURRENT_STACK" =  "dotnetcore"
    }
New-AzResource -PropertyObject $PropertiesObject -ResourceGroupName <group-name> -ResourceType Microsoft.Web/sites/slots/config -ResourceName "<webapp-name>/<slot-name>/metadata" -ApiVersion 2018-02-01 -Force

enter image description here

在门户中检查结果:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.