Optimize Token Fetch calls across multiple CosmosClient connections #4288
-
I have a couple of questions about token caching when creating the CosmosClient within our service. In our case, we use the token credential to create the CosmosClient and we connect with 50-60 accounts per DC, so that would the number of CosmosClient instances we would have. Questions,
To clarify, we are looking to optimize on the calls to AAD to fetch the token. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
TokenReqeustContext Cosmos SDK uses is for scope https://{endpointUri.Host}/.default Token caching:
|
Beta Was this translation helpful? Give feedback.
-
Couple more quick questions, For the CosmosClient setup with AAD token Auth,
|
Beta Was this translation helpful? Give feedback.
-
Client initialization: Will do service interaction asynchronously (even with-out API invocation), which will needs the AAD token. 429 from AAD:
|
Beta Was this translation helpful? Give feedback.
TokenReqeustContext Cosmos SDK uses is for scope https://{endpointUri.Host}/.default
In-case multiple-CosmosClients are created for different accounts then the token will be different for each account.
Token caching: