-
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
v3.0.1: azurerm_key_vault: Cannot read the ressource with KeyVault: keyvault.BaseClient#GetCertificateContacts #16052
Comments
I have a similar issue. Simply referencing a certificate in a key vault causes the plan to fail `data "azurerm_key_vault" "keyVault" {
name = "XXX"
resource_group_name = "YYY"
}
# Get ID for latest certificate version in KV
data "azurerm_key_vault_secret" "certificate" {
name = "ZZZ"
key_vault_id = data.azurerm_key_vault.keyVault.id
} The plan command fails (after a long while) with the following error: ╷
│ Error: making Read request on Azure KeyVault Secret <name redacted>: autorest/Client#Do: Preparing request failed: StatusCode=0 -- Original Error: authorizer was not an auth.CachedAuthorizer for https://vault.azure.net
│
│ with data.azurerm_key_vault_secret.certificate,
│ on subscription.tf line 13, in data "azurerm_key_vault_secret" "certificate":
│ 13: data "azurerm_key_vault_secret" "certificate" {
│
╵
Releasing state lock. This may take a few moments... |
I have these both issues as well. Had to roll back to provider 2.99.0 |
Just hit this one... Terraform 1.1.7 |
I just ran into a similar issue with azurerm_key_vault_secret data source
I see this for both v3.0.0 and v3.0.1 |
Hi, thanks for reporting this. I'm looking at each report in this issue in turn and trying to reproduce across the authentication methods we support, however it would help greatly if anyone getting a timeout or "context deadline exceeded" error, were able to post a debug log (via gist) whilst this is happening. You can do this by setting the TF_LOG=debug terraform apply |
I got another error We are using: |
@manicminer I'm preparing a gist but does the azurerm provider team have a different public key than the terraform one? I'm going to redact the file but would still prefer to encrypt it. |
@SimonGasparKentico, @noiano I believe I may have found an issue with Azure CLI authentication and Key Vault. |
@djryanj If you wish to encrypt your log, please use the public key for the "terraform" Keybase user. Thanks! |
@djryanj Nevermind, I was able to decrypt the log! It looks like you're getting the |
@uncycler, @kovaliovsg, @cmendible, @nbjohnson Would you be able to share a debug log for when you're seeing the "context deadline exceeded" error for a Key Vault related resource? Thanks! |
@manicminer glad you found the key, I promptly broke my terraform config after hitting this bug (developing something else, this was non-blocking for the moment) and also (like an idiot) deleted the debug log so couldn't reproduce quickly enough. I am using Azure CLI authentication. |
Sorry no logs since I reverted back. I'm also using Azure CLI authentication |
Here are my TF_DEBUG logs. I have the Using Azure CLI auth. https://gist.github.com/eoly/702d9e6da370cd946372bce3677db830 |
I am hitting this error as well Terraform version 1.1.6 Reverting back to 2.99 corrected the issue. |
@eoly Thanks for the log, that's super helpful 👍 Anyone else, please kindly refrain from posting +1 comments and instead upvote the issue. Debug logs are always happily received! |
Fixes the authorizer was not an auth.CachedAuthorizer for https://vault.azure.net error reported in #16052
I'm actually using a service principal to authenticate all actions against my subscription ... I'd also like to add that, using azurerm It's only much slower. |
Even after upgrading to v3.0.2, I am still getting a similar, but not exactly the same error. I am attempting to do a data source lookup for a key vault secret. This works on versions < 3.0.0, but is now just broken. If there is a breaking change that I am missing that could be affecting this let me know, or is this a bug related to the other errors users are reporting?
For initial Azure auth I am using CLI |
@nbjohnson - try doing an |
@djryanj Thanks for the suggestion, but unfortunately that didn't fix my issue. Still keep getting |
@nbjohnson Thanks for the feedback. I've been unable to reproduce that error, which is related to a failure invoking az-cli to acquire an access token. I would suggest upgrading to the latest version of Azure CLI, and deleting your |
With USGovernment environment, the example key vault fails to get created or read from state, even with the latest versions of Terraform or azurerm.
See relevant gist. Terraform versions:
|
I believe this issue may be related to Works: v2.99 with
|
There is a related issue #16291 which affects USGovernment users when managing Key Vaults (or any resource that uses the Key Vault API). This will be fixed in next week's release. Is anyone here not using the USGovernment cloud and experiencing a |
@manicminer i do and i'm pretty sure i'm not the only one. |
Any update on this? Same error with AzureRm 3.1 on our side. |
Per @manicminer's comment above this has been fixed in more recent versions of the AzureRM Provider, we're currently on version v3.5.0 - if you're still encountering this issue when using v3.5.0 please let us know, but I'm going to close this out as fixed at the moment since we believe this has since been fixed. Thanks! |
@tombuildsstuff thanks for the reply. We are having this issue on the global Azure cloud so maybe this issue doesn't really fit for me because it is only for the USGov Cloud. Using AzureRM 3.5. doesn't fix my issue. As we are using a Private Endpoint for the connection it seems more related to #9738 |
We too are having this issue on AzureRM 3.7. global azure cloud (non USGov). |
Same, seems like our general performance of terraform/azurerm provider have drastically reduced lately and we are seeing the context deadline issues as well (none gov as well). |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v1.1.7
azurerm v3.0.1
Affected Resource(s)
azurerm_key_vault
Expected Behaviour
No error
Actual Behaviour
Cannot read the ressource with `KeyVault: keyvault.BaseClient#GetCertificateContacts: Failure sending request: StatusCode=0 -- Original Error: context deadline exceeded
Steps to Reproduce
Important Factoids
Since v3, azurerm is trying to fetch "contact" from KeyVault and for some reason, the access is timing out. I've tried adding ManagedContacts permission but no luck.
Using same credentials, I can access the API without isuse.
The text was updated successfully, but these errors were encountered: