-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_key_vault ignores tenant_id #26056
Comments
Hi @rmmason , Thanks for filing this issue. could you try adding the |
Hi @wuxu92 - Thank you for your response. We have already tried that and the error still occurs. |
@rmmason, thank you for the update. Upon reviewing this case, I am wondering if there is a situation where it is necessary to create a key vault in a different tenant ID. I have not been able to find any documentation on this matter, apart from the swagger definition. Additionally, when observing the portal page, it appears that a key vault with a different tenant ID has limited functionality despite its provisioning state being "Succeeded." The linked document suggests that this should only occur when transferring an Azure Key Vault to another subscription. |
@wuxu92 - Can you provide me with the link to where you think it suggests it shouldn't work? So far the KeyVault is the only piece of architecture we have had a problem with. We are authenticating as an external user in the current tenant so those user accounts do exist as (external users /guests) in the current tenant. Maybe I could raise a ticket with Microsoft to ask if they could confirm if this should be possible on the backend and point them to this ticket if it is unclear in the documentation. |
Facing the same issue but I am not external user. My user is present in tenant id. During "terraform plan" it gives me correct tenant id but after when I apply then I found that in tfstate the tenant id for Key Vault is completely different, |
Is there an existing issue for this?
Community Note
Terraform Version
1.6.6
AzureRM Provider Version
3.103.1
Affected Resource(s)/Data Source(s)
azurerm_key_vault
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The keyvault should be created with a directory id which matches the supplied tenant_id and there shouldn't be an error.
Actual Behaviour
The keyvault is created, however, it has ignored the tenant_id provided which was the same as the subscription and has a directory_id in the portal which matches the external users home directory and not the subscription directory.
The keyvault is subsequently unusable and has an error at the top of the overvoew pane which says "The directory () currently selected differes from this key vaults's directory. Some actions will be disabled."
Steps to Reproduce
Important Factoids
Running the scripts as an External User as this is on a customers subscription.
References
No response
The text was updated successfully, but these errors were encountered: