最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Terraform apparently does not populate ASP.NET Core stack settings for an Azure web app on Linux - Stack Overflow

programmeradmin1浏览0评论

I have a terraform script to create an ASP.NET Core 9.0 on Azure using the following snippet:

resource "azurerm_linux_web_app" "webapp" {
  name                = var.management_portal.name
  location            = var.resource_group.location
  resource_group_name = var.resource_group.name
  service_plan_id     = azurerm_service_plan.service_plan.id
  https_only = true
  site_config {
    application_stack {
      dotnet_version = "9.0"
    }
    always_on = true
  }
  app_settings = {
    "WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false"
  }
}

After running the script and deploying the asp application using Azure DevOps pipeline, I realized the following entries were not populated by terraform causing the app not to run; and, what you see on this screenshot are manually selected and applied by myself:

After choosing the entries above the asp core's web page appeared on the browser. How to resolve this issue such that a manual intervention to set the stack settings should not be necessary.

This my provider:

required_providers {
    azurerm = {
        source  = "hashicorp/azurerm"
        version = "4.25.0"
    }
}

I have a terraform script to create an ASP.NET Core 9.0 on Azure using the following snippet:

resource "azurerm_linux_web_app" "webapp" {
  name                = var.management_portal.name
  location            = var.resource_group.location
  resource_group_name = var.resource_group.name
  service_plan_id     = azurerm_service_plan.service_plan.id
  https_only = true
  site_config {
    application_stack {
      dotnet_version = "9.0"
    }
    always_on = true
  }
  app_settings = {
    "WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false"
  }
}

After running the script and deploying the asp application using Azure DevOps pipeline, I realized the following entries were not populated by terraform causing the app not to run; and, what you see on this screenshot are manually selected and applied by myself:

After choosing the entries above the asp core's web page appeared on the browser. How to resolve this issue such that a manual intervention to set the stack settings should not be necessary.

This my provider:

required_providers {
    azurerm = {
        source  = "hashicorp/azurerm"
        version = "4.25.0"
    }
}
Share Improve this question edited Mar 30 at 18:47 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Mar 30 at 15:39 ArashArash 4,2767 gold badges50 silver badges82 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

After some investigating and narrowing down the issue, it turns out the release pipeline was the culprit not the terraform script. We need to ensure not to specify the .NET SDK version in the release pipeline's deployment task.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论