-2

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.net 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:

enter image description here

After choosing the entries above the asp.net 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"
    }
}

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.