首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >LinuxFxVersion -本机提供程序: Azure WebApp:参数Pulumi Azure的值无效

LinuxFxVersion -本机提供程序: Azure WebApp:参数Pulumi Azure的值无效
EN

Stack Overflow用户
提问于 2021-03-08 04:12:19
回答 1查看 426关注 0票数 0

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

代码语言:javascript
运行
复制
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,我得到以下错误:

代码语言:javascript
运行
复制
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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-08 04:12:19

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

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

代码语言:javascript
运行
复制
const appServicePlan = new azure.web.AppServicePlan("sp-spring-boot", {
    location: resourceGroup.location,
    resourceGroupName: resourceGroup.name,
    kind: "Linux",
    reserved: true,
    sku: {
        name: "B1",
        tier: "Basic",
    },
});

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66520937

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档