hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.51k stars 4.6k forks source link

Terrafrom not detecting updating of dotnet version of azurerm_linux_web_app 6.0 -> 8.0 #26520

Open davidelcheikh opened 2 months ago

davidelcheikh commented 2 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.9.0

AzureRM Provider Version

3.110.0

Affected Resource(s)/Data Source(s)

azurerm_linux_web_app

Terraform Configuration Files

resource "azurerm_linux_web_app" "appServer" {
  name = "app-server-001"
  resource_group_name = azurerm_resource_group.rg.name
  location            = azurerm_resource_group.rg.location
  service_plan_id     = azurerm_service_plan.id
  https_only          = true
  site_config {
    vnet_route_all_enabled = true
    always_on              = true
    application_stack {
      dotnet_version = "8.0"
    }
    minimum_tls_version = "1.2"
  }

Debug Output/Panic Output

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Expected Behaviour

Deploy app service with .NET 8.0

Actual Behaviour

When running terraform apply with dotnet_version = "8.0" (server version is "6.0"), terraform is not detecting there's been a change in the server infrastructure

Steps to Reproduce

terraform apply -var-file="variables\vars.tfvars.json"

Important Factoids

No response

References

Reference colleagues stack overflow article: https://stackoverflow.com/questions/78694934/terraform-is-not-applying-the-dotnet-version-change-on-azurerm-linux-web-app-app

xiaxyi commented 2 months ago

Thanks @davidelcheikh for raising this issue, the terraform can successfully detect the dotnet version change in my local test as: image

Are you seeing any diff during the plan? I can't see any log relates to terraform plan so it would be great if you can run terraform plan and share the result here.

davidelcheikh commented 2 months ago

That's strange. I also tried to the same and changed my dotnet_version from 8.0 to 6.0 and terraform and I got nothing. See below:

The left is the updated infrastructure and the right is the tfstate file:

2024-07-03_10-43
xiaxyi commented 2 months ago

@davidelcheikh Can you share the output of terraform plan? And just to double confirm that you do use the latest AzureRM provider?

davidelcheikh commented 2 months ago

@xiaxyi the terraform plan doesn't have the change in dotnet version unfortunately :(

image

xiaxyi commented 2 months ago

@davidelcheikh Can you enable TF log by setting the environment variable

export TF_LOG=DEBUG
export TF_LOG_PATH=C:/Users/xx/logs/debug.log

then run terraform plan / apply and share the debug log here?

dpickeringjudge commented 1 month ago

We're seeing the same thing as well -- anything new?

oatsoda commented 2 hours ago

Having this same issue using Terraform 1.9.5 with azurerm_linux_web_app.

Providers:

  required_providers {
    azuread = {
      source  = "hashicorp/azuread"
      version = "~> 1.5.1"
    }
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "~> 3.116.0"
    }
    random = {
      source  = "hashicorp/random"
      version = "~> 3.1.0"
    }
  }