You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
azurerm_eventhub_namespace.example: Destroying... [id=/subscriptions/<subscription-id>/resourceGroups/test-462912/providers/Microsoft.EventHub/namespaces/eventhub-ns]
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 10s elapsed]
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 20s elapsed]
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 30s elapsed]
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 40s elapsed]
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 50s elapsed]
azurerm_eventhub_namespace.example: Destruction complete after 50s
...
azurerm_resource_group.example: Destruction complete after 1m21s
Destroy complete! Resources: 3 destroyed.
Actual Behaviour
The resource_group cannot be deleted because Terraform has detected that the eventhub_namespace still exists, even though it was successfully deleted according to the log:
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 20s elapsed]
azurerm_eventhub_namespace.example: Still destroying... [id=/subscriptions/<subscription-id>-...EventHub/namespaces/eventhub-ns, 30s elapsed]
azurerm_eventhub_namespace.example: Destruction complete after 32s
azurerm_resource_group.example: Destroying... [id=/subscriptions/<subscription-id>/resourceGroups/test-462912]
╷
│ Error: deleting Resource Group "test-462912": the Resource Group still contains Resources.
│
│ Terraform is configured to check for Resources within the Resource Group when deleting the Resource Group - and
│ raise an error if nested Resources still exist to avoid unintentionally deleting these Resources.
│
│ Terraform has detected that the following Resources still exist within the Resource Group:
│
│ *`/subscriptions/<subscription-id>/resourceGroups/test-462912/providers/Microsoft.EventHub/namespaces/eventhub-ns`
│
│ This feature is intended to avoid the unintentional destruction of nested Resources provisioned through some
│ other means (for example, an ARM Template Deployment) - as such you must either remove these Resources, or
│ disable this behaviour using the feature flag `prevent_deletion_if_contains_resources` within the `features`
│ block when configuring the Provider, for example:
│
│ provider "azurerm" {
│ features {
│ resource_group {
│ prevent_deletion_if_contains_resources = false
│ }
│ }
│ }
│
│ When that feature flag is set, Terraform will skip checking for any Resources within the Resource Group and
│ delete this using the Azure API directly (which will clear up any nested resources).
│
│ More information on the `features` block can be found in the documentation:
│ https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#features
│
│
│
╵
Steps to Reproduce
terraform init
terraform apply
terraform destroy
Important Factoids
References
#0000
The text was updated successfully, but these errors were encountered:
Hey @F-Joachim - thanks for letting us know about this bug. Looks like there can be some eventually consistency issues with this check, especially with certain services. we've open #16073 that adds some retries to give azure time to settle so hopefully that will resolve this for you!
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.
Community Note
Terraform (and AzureRM Provider) Version
Providers:
hashicorp/azurerm
=>3.0.1
Affected Resource(s)
azurerm_eventhub_namespace
Terraform Configuration Files
Debug Output
-
Panic Output
-
Expected Behaviour
All resources should be successfully destroyed.
Actual Behaviour
The
resource_group
cannot be deleted because Terraform has detected that theeventhub_namespace
still exists, even though it was successfully deleted according to the log:Steps to Reproduce
terraform init
terraform apply
terraform destroy
Important Factoids
References
The text was updated successfully, but these errors were encountered: