gpt4 book ai didi

azure - Azure 应用服务的 Terraform 模板,LinuxFxVersion 具有无效值

转载 作者:行者123 更新时间:2023-12-03 01:18:03 26 4
gpt4 key购买 nike

这就是我的 terraform 模板的样子:

resource "azurerm_resource_group" "example" {
name = "myAppServiceRG"
location = var.location
}

resource "azurerm_service_plan" "example" {
name = var.servicePlanName
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
os_type = "Linux"
sku_name = var.pricingTier
worker_count = var.nodesInWebFarm
}
resource "azurerm_linux_web_app" "example" {
name = var.appName
resource_group_name = azurerm_resource_group.example.name
location = azurerm_service_plan.example.location
service_plan_id = azurerm_service_plan.example.id

site_config {
application_stack {
docker_image = var.dockerHubImage
docker_image_tag = "latest"
}
}
}

和parameters.tfvars文件:

location        = "West Europe"
servicePlanName = "someserviceplan"
nodesInWebFarm = 2
pricingTier = "P1v2"
appName = "myuniquelinuxwebapplication"
dockerHubImage = "DOCKER|mcr.microsoft.com/dotnet/samples:aspnetapp"

但由于某些原因,当我尝试执行 terraform apply -var-file .\parameters.tfvars 时,我收到此错误:

Error: creating Linux Web App: (Site Name "myuniquelinuxwebapplication" / Resource Group "myAppServiceRG"): web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original 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"]}}]

有谁知道为什么,以及如何改变它?

最佳答案

听起来您的 Linux 服务计划和 Docker 容器之间不匹配。

我认为将容器更改为 Linux 版本可以解决这个问题

完整标签在此页面上(向下滚动一点)https://hub.docker.com/_/microsoft-dotnet-samples

关于azure - Azure 应用服务的 Terraform 模板,LinuxFxVersion 具有无效值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73548912/

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