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.46k stars 4.54k forks source link

``azurerm_api_management`` Error while creating a new APIM service - can't delete "echo-api" #26438

Open Apokalypt opened 1 week ago

Apokalypt commented 1 week ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.5

AzureRM Provider Version

3.109.0

Affected Resource(s)/Data Source(s)

azurerm_api_management

Terraform Configuration Files

provider "azurerm" {
  features {}
}

resource "azurerm_api_management" "apim" {
  location            = "westeurope"
  name                = "test-debug-apim"
  publisher_email     = "<valid email>"
  publisher_name      = "Test"
  resource_group_name = "<valid group>"
  sku_name            = "Developer_1"
}

Debug Output/Panic Output

https://gist.github.com/Apokalypt/46f1e5b9d8380869dd79cb979d37f5b5

Expected Behaviour

Actual Behaviour

Steps to Reproduce

  1. terraform plan
  2. terraform apply

-> Sometimes the full creation (service creation + API deletion) works correctly so you may have to repeat these steps 2 or 3 times... If that's the case don't forget to remove APIM service before

Important Factoids

No response

References

No response

Apokalypt commented 1 week ago

Based on my tries, it seems that the problem comes from Azure API but maybe it's due to an invalid body sent from Terraform

sinbai commented 1 week ago

Hi @Apokalypt thanks for opening this issue. In order to find the root cause, a Terraform configuration (containing dependent resources and variable values) and detailed steps would be of great help in quickly reproducing/troubleshooting the issue. Could you please provide the complete Terraform configuration and detailed repro steps to help reproduce this issue? Thanks in advanced.

stephybun commented 1 week ago

Seems to be related to https://github.com/hashicorp/terraform-provider-azurerm/issues/26386

Apokalypt commented 1 week ago

Seems to be related to #26386

Yeah, apparently it has been fix by Azure... I will make a few try later to make sure everything is ok

Apokalypt commented 1 week ago

Hi @Apokalypt thanks for opening this issue. In order to find the root cause, a Terraform configuration (containing dependent resources and variable values) and detailed steps would be of great help in quickly reproducing/troubleshooting the issue. Could you please provide the complete Terraform configuration and detailed repro steps to help reproduce this issue? Thanks in advanced.

This is the exact file configuration and steps I've done đŸ˜… So, I'm not sure to understand what's missing. However, I will take some time to verify it to make sure that everything is ok because maybe some values are set automatically due to our Azure environment