gpt4 book ai didi

azure - Pulumi azure 原生提供商 : Azure WebApp: The parameter LinuxFxVersion has an invalid value

转载 作者:行者123 更新时间:2023-12-03 04:48:17 35 4
gpt4 key购买 nike

我使用 Pulumi CLI 创建了一个新的 Pulumi Typescript 程序 pulumi new azure-typescript并创建了以下index.ts (基于新的azure-native provider):

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure-native";

const resourceGroup = new azure.resources.ResourceGroup("rg-spring-boot", {location: "West Europe"});

const appServicePlan = new azure.web.AppServicePlan("sp-spring-boot", {
location: resourceGroup.location,
resourceGroupName: resourceGroup.name,
kind: "Linux",
sku: {
name: "B1",
tier: "Basic",
},
});

// Image https://hub.docker.com/r/jonashackt/spring-boot-vuejs
const imageName = "jonashackt/spring-boot-vuejs:latest";

const appServiceSpringBoot = new azure.web.WebApp("spring-boot-vuejs-azure", {
location: resourceGroup.location,
resourceGroupName: resourceGroup.name,
serverFarmId: appServicePlan.id,
siteConfig: {
linuxFxVersion: `DOCKER|${imageName}`,
},
httpsOnly: true,
});

现在运行 pulumi up -y我收到以下错误:

pulumi up -y
Previewing update (dev)

View Live: https://app.pulumi.com/jonashackt/spring-boot-pulumi-azure/dev/previews/3317933e-0051-4dfc-b436-8fe4184d11f5

Type Name Plan
pulumi:pulumi:Stack spring-boot-pulumi-azure-dev
+ └─ azure-native:web:WebApp spring-boot-vuejs-azure create

Outputs:
+ helloEndpoint: output<string>

Resources:
+ 1 to create
3 unchanged

Updating (dev)

View Live: https://app.pulumi.com/jonashackt/spring-boot-pulumi-azure/dev/updates/5

Type Name Status Info
pulumi:pulumi:Stack spring-boot-pulumi-azure-dev **failed** 1 error
+ └─ azure-native:web:WebApp spring-boot-vuejs-azure **creating failed** 1 error

Diagnostics:
azure-native:web:WebApp (spring-boot-vuejs-azure):
error: Code="BadRequest" Message="The parameter LinuxFxVersion has an invalid value." Details=[{"Message":"The parameter LinuxFxVersion has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"01007","Message":"The parameter LinuxFxVersion has an invalid value.","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["LinuxFxVersion"]}}]

pulumi:pulumi:Stack (spring-boot-pulumi-azure-dev):
error: update failed

Resources:
3 unchanged

Duration: 22s

这里还有 the full example project .

最佳答案

如本 so answer 中所述问题出在 azure.web.AppServicePlan 中的 Azure AppService 配置中。虽然我们设置了 kind: "Linux",但它实际上是一台 Windows 机器。

缺少的参数是 reserved: true, 在我们的 AppService 中:

const appServicePlan = new azure.web.AppServicePlan("sp-spring-boot", {
location: resourceGroup.location,
resourceGroupName: resourceGroup.name,
kind: "Linux",
reserved: true,
sku: {
name: "B1",
tier: "Basic",
},
});

As the documentation states如果没有将 reserved 参数设置为 true,我们就得到了一台 Windows 机器。如果您使用不带参数的 kind: "Linux" ,这甚至会显示在 Azure 门户中:

enter image description here

关于azure - Pulumi azure 原生提供商 : Azure WebApp: The parameter LinuxFxVersion has an invalid value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66520937/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com