You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use service principals with Azure (with secret or with cert)
Ensure AuthBySecretCallBack gets called many times (which seems to be the case)
Actual: app.acquireToken always fetches the token from the token issuer service (AAD), over HTTP. While this is normally fast, P50 is ~1 second, any availability issues and spikes in latency destabilize the app.
Expected: app object should be reused, so as to serve tokens from the memory cache.
Impact: Azure Active Directory (AAD) has been receiving incidents related to availability and latency of products using this guidance. By not using cached tokens, apps are frail and have single point of failure in the identity provider.
Root cause
The acquireToken method creates a ConfidentialClientApplication object app each time and requests a token. Once the token is retrieved, the token is cached, but the app object goes out scope. Creating the ConfidentialClientApplication everytime negates the use of cached tokens. A token is available for at least 1h, usually for 24h.
This is a bug in your guidance
See https://github.com/Azure/azure-event-hubs-spark/blob/master/docs/use-aad-authentication-to-connect-eventhubs.md
Repro steps
AuthBySecretCallBack
gets called many times (which seems to be the case)Actual:
app.acquireToken
always fetches the token from the token issuer service (AAD), over HTTP. While this is normally fast, P50 is ~1 second, any availability issues and spikes in latency destabilize the app.Expected:
app
object should be reused, so as to serve tokens from the memory cache.Impact: Azure Active Directory (AAD) has been receiving incidents related to availability and latency of products using this guidance. By not using cached tokens, apps are frail and have single point of failure in the identity provider.
Root cause
The
acquireToken
method creates aConfidentialClientApplication
objectapp
each time and requests a token. Once the token is retrieved, the token is cached, but theapp
object goes out scope. Creating theConfidentialClientApplication
everytime negates the use of cached tokens. A token is available for at least 1h, usually for 24h.Suggested fix
(pseudocode, sorry I don't know Scala)
The text was updated successfully, but these errors were encountered: