Open rmmason opened 5 months ago
Hi @rmmason , Thanks for filing this issue. could you try adding the subscription-tenant-id
to the auxiliary_tenant_ids field and see if it resolve the error?
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