Skip to content

Conversation

tvaron3
Copy link
Member

@tvaron3 tvaron3 commented Oct 16, 2025

Description

Currently, azure credentials don't protect against concurrent calls at setup to populate cache. This could result in extra unnecessary calls aad calls at bootup before the cache in the credential is filled. Customers should use a singleton credential and share it across their cosmos clients. There are several layers of caching for aad calls. This change is targeting populating the cache in the token credential to be filled with only one request.

Solution

Cosmos client will now keep a static map of the credential instance and their corresponding locks, and each client will perform one get_token on the credential to fill up the cache. If getting the token fails, the exception is swallowed and logged as a warning. This approach was taken to not affect or reimplement the fallback logic for fabric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant