-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Library name and version
Azure.Identity 1.12.0, Azure.Security.KeyVault.Keys 4.6.0
Describe the bug
Azure.Security.KeyVault maintains a dictionary of key vault URIs to ChallengeParameters [1]. If a request has already been made to key vault, the challenge parameters determined by the SDK are stored in the cache and used for future requests. The tenant ID determined by the SDK is prioritized over the one provided by the caller [2].
The ChallengeParameter cache is never invalidated. If the key vault tenant ID changes due to subscription migration, then key vault requests will fail until the process restarts.
This behavior is affecting Ultra Disk storage. Customers cannot associate their key vault with a migrated disk due to this caching behavior. Restarting the service is not an ideal solution due to performance and availability SLAs.
[1]
Line 22 in fca5abb
| private static readonly ConcurrentDictionary<string, ChallengeParameters> s_challengeCache = new(); |
Expected behavior
Should be able to make key vault requests after creating a new key vault with the same name in a different tenant without restarting the application.
Actual behavior
Creating a key vault in a new tenant with the same name as the old tenant causes a conflict with the cached tenant ID making key vault requests impossible.
Reproduction Steps
- Have a key vault with a managed identity so you can make wrap/unwrap requests
- Delete the key vault and re-create the key vault with the same name in another tenant and create a new identity to access the key vault.
- Update the key vault, client ID, tenant ID, and credential without restarting your process
- Key vault requests fail
Environment
- Microsoft Windows Server 2022 Datacenter 10.0.20348
- .net framework 4.7.2
Metadata
Metadata
Assignees
Labels
Type
Projects
Status