terraform-provider-azurerm: Terraform detects and applies changes in azurerm_windows_web_app even though the configuration is not changed

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave β€œ+1” or β€œme too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.7

AzureRM Provider Version

3.0.2

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app

Terraform Configuration Files

resource "azurerm_windows_web_app" "appservice" {
  name                = "${var.environment.shortlocation}-tf-appw-${var.ProjectName}-${var.DeployStage}"
  location            = azurerm_resource_group.rootrsgp01.location
  resource_group_name = azurerm_resource_group.rootrsgp01.name
  service_plan_id     = azurerm_service_plan.appserviceplan.id
  client_affinity_enabled = true

  site_config {

    ftps_state = "AllAllowed"
    always_on = true
    managed_pipeline_mode = "Integrated"
    minimum_tls_version = 1.2
    # remote_debugging = false
    use_32_bit_worker = false
    websockets_enabled = true
    
    application_stack {
      current_stack = "dotnet"
      dotnet_version = "v6.0"
    }

  }


  logs {

    detailed_error_messages = true
    failed_request_tracing = true
  }

  backup{
    name = "appservicedailybackup"
    enabled = true
    storage_account_url = "https://${azurerm_storage_account.storageccount01.name}.blob.core.windows.net/${azurerm_storage_container.appcontainer.name}${data.azurerm_storage_account_sas.stablobsas.sas}&sr=b"

    schedule {
      frequency_interval = 1
      frequency_unit = "Day"
      keep_at_least_one_backup = true
      retention_period_days = 4

    }
  }
}

Debug Output/Panic Output

2022-04-05T08:54:53.5369453Z   # azurerm_windows_web_app.appservice will be updated in-place
2022-04-05T08:54:53.5370327Z   ~ resource "azurerm_windows_web_app" "appservice" {
2022-04-05T08:54:53.5371809Z         id                                = "/subscriptions/f9d805c8-0231-4f5d-adc0-4e0dc34c9c2c/resourceGroups/dewc-TF-RSGP-adspaceIO-dev-01/providers/Microsoft.Web/sites/dewc-tf-appw-adspaceIO-dev-01"
2022-04-05T08:54:53.5372431Z         name                              = "dewc-tf-appw-adspaceIO-dev-01"
2022-04-05T08:54:53.5372780Z         tags                              = {}
2022-04-05T08:54:53.5373076Z         # (18 unchanged attributes hidden)
2022-04-05T08:54:53.5373512Z 
2022-04-05T08:54:53.5373640Z 
2022-04-05T08:54:53.5373750Z 
2022-04-05T08:54:53.5374075Z       ~ logs {
2022-04-05T08:54:53.5374503Z             # (2 unchanged attributes hidden)
2022-04-05T08:54:53.5374749Z 
2022-04-05T08:54:53.5375150Z           - application_logs {
2022-04-05T08:54:53.5375687Z               - file_system_level = "Error" -> null
2022-04-05T08:54:53.5376040Z 
2022-04-05T08:54:53.5376396Z               - azure_blob_storage {
2022-04-05T08:54:53.5377293Z                   - level             = "Error" -> null
2022-04-05T08:54:53.5377938Z                   - retention_in_days = 0 -> null
2022-04-05T08:54:53.5378379Z                 }
2022-04-05T08:54:53.5378568Z             }
2022-04-05T08:54:53.5378676Z 
2022-04-05T08:54:53.5378907Z           - http_logs {
2022-04-05T08:54:53.5379034Z 
2022-04-05T08:54:53.5379274Z               - file_system {
2022-04-05T08:54:53.5379806Z                   - retention_in_days = 0 -> null
2022-04-05T08:54:53.5380257Z                   - retention_in_mb   = 35 -> null
2022-04-05T08:54:53.5380578Z                 }
2022-04-05T08:54:53.5380765Z             }
2022-04-05T08:54:53.5380965Z         }
2022-04-05T08:54:53.5381049Z 
2022-04-05T08:54:53.5381264Z       ~ site_config {
2022-04-05T08:54:53.5381579Z             # (23 unchanged attributes hidden)
2022-04-05T08:54:53.5381735Z 
2022-04-05T08:54:53.5381984Z           ~ application_stack {
2022-04-05T08:54:53.5382298Z               + current_stack  = "dotnet"
2022-04-05T08:54:53.5382653Z                 # (1 unchanged attribute hidden)
2022-04-05T08:54:53.5383755Z             }
2022-04-05T08:54:53.5383959Z         }
2022-04-05T08:54:53.5384203Z         # (2 unchanged blocks hidden)
2022-04-05T08:54:53.5384467Z     }
2022-04-05T08:54:53.5384550Z

Expected Behaviour

Terraform plan should not have detected changes in the azurerm_windows_web_app because the configuration file is not changed at all.

Actual Behaviour

Terraform plan always detects and applies the same changes for the azurerm_windows_web_app in every TF Plan and TF Apply execution although the configuration for azurerm_windows_web_app has not been changed at all.

Steps to Reproduce

  1. terraform validate
  2. terraform plan
  3. terraform apply

Important Factoids

No response

References

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 29
  • Comments: 21 (3 by maintainers)

Most upvoted comments

We are also facing the same issue for Linux Appservice without any changes and showing everytime on the plan and causing the application to restart, image

I have updated to latest TF Version : 1.4.6 and latest RM Provider : 3.58.0 still facing the same issue.

Just to add to @silambarasan , we are having the same problem with the windows_web_app: image

Same here

image

@KangDroid no worries, this is not an urgent issue (for us at least). As far as I can tell the app service still works with the current_stack property missing, and reapplying the same configuration adds the property back in.