-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to determine the Resource ID for the Key Vault at URL #19322
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm seeing this issue as well - I'm wondering how many other reporters of this issue are using Private Endpoints in addition to public access for their KeyVault (as I am)? I have enabled debug logging in my pipeline run for Terraform, and I can tell these errors are surfaced by the
I have a few suspicions at this point that I'm trying to narrow down, but the debug logs aren't really giving an indication
I do know that when I re-run my destroy, AFTER my |
I've traced this particular issue a little further in my environment, and I think it is due to some unexpected behaviour with the Azure REST API. When I closely inspect the debug logs of a destroy operation, I noticed two things:
Surprisingly, # 1 returns the object properties of the KeyVault, and # 2 returns a blank value, even though it is the same KeyVault! This is where the original error is coming from; the Secret resource has the ID reference, but during the destroy operation the lookup for the KeyVault doesn't return any values. I have confirmed this both in Postman, and in the Resource Explorer. The latter for example, when I navigate through But if I navigate through the resource group, I do see it! Even more strange, within the Resource List api (not scoped through a resource group) it returns KeyVaults that no longer exist (such as the "kv-*-vlnb" in the first image; not even in a Soft-Delete stage. I cannot understand how this can be - a resource can exist and function, but only partially discover-able by the API, hidden if you are looking at the subscription scope instead of resource group? I will likely open a support ticket with Azure about this, but if there are any internal Hashicorp or Microsoft resources who see this, help would certainly be appreciated. Edit: 20 minutes after typing this, while trying to gather screenshots for an Azure support ticket, my Postman queries magically showed the KeyVault and had removed the actual non-existent ones. My hunch is some kind of delay in replication of objects across regions, which is terrible for a CI/CD pipeline of a Terraform module that is doing an apply and destroy 😟 Edit 2: it appears this terraform provider issue is directly related to similar behaviour found in Azure CLI: Azure/azure-cli#23428 |
Same on my side; on a terraform destroy I get Error: Unable to determine the resource ID for the key vault at URL if the key vault was previously created in a terraform apply run. If I run terraform destroy again, the key vault is removed and destroy is successful. Right now this is a blocking issue for me as I rely on terraform apply plus destroy in my pipelines so that I can be sure that my development is always able to build and destroy the whole stack. FYI, I have already bumped to the versions azurerm: 3.48.0 and terraform: 1.4.1. @jeffwmiles are you still facing this issue? |
@tschechniker anything new about this topic? Do you have a workaround? |
This comment was marked as off-topic.
This comment was marked as off-topic.
I've got this issue blocking me today. Azure Key Vaults, created on previous days so less likely to be propagation lag, refresh during Adding to the fun, the state file shows the full and correct resource IDs but won't use them. I workaround would be an override command to allow the use of IDs from state rather than the API values that the user above reports are missing. |
I have the same issue with azurerm v3.78.0. Manually testing with curl showed propagation lag on the resources List api on my end (~15-20 mins), which causes the failure when the KV is new and a destroy is called (typical use case seems to be TF module tests). |
It is interesting that the behavior seems to be random. We have pipelines with Terratest that regularly build and destroy KeyVaults and some destroys work fine, some exit with "unable to determine the Resource ID for the Key Vault at URL". Our pipeline logs unfortunately only go back 6 months, but in this period I could not find any pipeline with this error until yesterday. Since yesterday every pipeline failed with it, even using the same provider version and tf-files that once worked. |
I'm running Terraform v1.6.3 and azurerm v3.89.0 with similar setup. Unfortunately I still run into this issue in my tests module trying to destroy a key vault and a key vault key even though it seems to be fixed with azurerm v3.83. |
I'm hitting this issue with Terraform
|
Experiencing this same issue with Terraform 1.7.5 and azurerm 3.91.0, although it happens randomly and not on every terraform destroy run. |
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. |
Is there an existing issue for this?
Community Note
Terraform Version
1.2.9
AzureRM Provider Version
3.30.0
Affected Resource(s)/Data Source(s)
Unable to determine the Resource ID for the Key Vault at URL
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
We are using Terratest to setup and destroy azure resources in a pipeline. The creation and the deletion works fine.
Actual Behaviour
The creation works fine but as soon as we run terraform destroy he cant find the resource id
Steps to Reproduce
terraform apply
terraform destroy
Important Factoids
Azure Westeurope
References
No response
The text was updated successfully, but these errors were encountered: