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.53k stars 4.6k forks source link

Error decoding "azurerm_windows_web_app" from prior state: a number is required #22843

Closed ValeruS closed 9 months ago

ValeruS commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.4

AzureRM Provider Version

= 3.63.0

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app

Terraform Configuration Files

resource "azurerm_windows_web_app" "name" {
  name                    = var.name
  location                = var.location
  resource_group_name     = var.resource_group_name
  service_plan_id         = azurerm_service_plan.name.id
  https_only              = true
  client_affinity_enabled = true

  site_config {
    ftps_state        = "Disabled"
    use_32_bit_worker = true

    application_stack {
      current_stack  = "dotnet"
      dotnet_version = "v4.0"
    }

    auto_heal_enabled = true
    auto_heal_setting {
      action {
        action_type                    = "CustomAction"
        minimum_process_execution_time = "00:00:00"
        custom_action {
          executable = "D:\\home\\data\\DaaS\\bin\\DaasConsole.exe"
          parameters = "-CollectKillAnalyze \"Memory Dump\""
        }
      }
      trigger {
        private_memory_kb = 1048576
        status_code {
          count             = 5
          interval          = "00:01:00"
          status_code_range = 502
          sub_status        = 3
        }
      }
    }
  }

  app_settings = {
    "WEBSITE_LOAD_USER_PROFILE" = "1",
    "MSDEPLOY_RENAME_LOCKED_FILES" = "1",
    "MobileAppsManagement_EXTENSION_VERSION" = "latest",
    "WEBSITE_DAAS_STORAGE_CONNECTIONSTRING"  = "DefaultEndpointsProtocol=https;AccountName=${var.sa_name};AccountKey=${var.sa_key};EndpointSuffix=core.windows.net"
  }
}

Debug Output/Panic Output

│ Warning: Failed to decode resource from state
│
│ Error decoding "azurerm_windows_web_app.name" from prior state: a number is required
╵
╷
│ Error: a number is required
│
│   with azurerm_windows_web_app.name,
│   on ../../modules/windows-web-app/main.tf line 53, in resource "azurerm_windows_web_app" "name":
│   53:         status_code {

Expected Behaviour

terraform plan/apply to work as expected

Actual Behaviour

Error: a number is required │ │ with module.web-app.azurerm_windows_web_app.name, │ on ../../modules/windows-web-app/main.tf line 53, in resource "azurerm_windows_web_app" "name": │ 53: status_code {

starting with the azurerm version 3.63.0 I receive the error "Error decoding "" from prior state: a number is required"

Steps to Reproduce

terraform plan

Important Factoids

No response

References

No response

rcskosir commented 1 year ago

Thank you for taking the time to open this issue. A related PR #23075 has merged and been released with v3.71.0. If you can, please upgrade and let us know if this resolved your issue.

rcskosir commented 9 months ago

Thanks for taking the time to submit this issue. It looks like this has been resolved as of #23075 as noted in my last comment. As such, I am going to mark this issue as closed. If that is not the case, please provide additional information including the version in which you are still experiencing this issue and we can reopen, thanks!

github-actions[bot] commented 4 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.