{Core} Add msal_telemetry to client telemetry#26980
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @jiasli, |
️✔️AzureCLI-BreakingChangeTest
|
|
Core |
| if not _session.msal_telemetry: | ||
| _session.msal_telemetry = msal_telemetry |
There was a problem hiding this comment.
If a CLI command makes several MSAL calls, only the first telemetry record is preserved.
The most special command is az login which calls acquire_token_interactive first, then several subsequent acquire_token_silent_with_errors:
acquire_token_interactive: initial loginacquire_token_silent_with_error: list tenantsacquire_token_silent_with_error: list subscriptions in tenant 1acquire_token_silent_with_error: list subscriptions in tenant 2- ...
If step 1 fails, its telemetry will be sent and az login will fail. If step 1 succeeds, its telemetry will be sent, and step 2 and following steps' telemetry will be discarded, no matter if they fail or not.
For long running operation commands such as az storage account create, only the MSAL telemetry for the initial PUT request is sent. Following MSAL telemetry for GET polling requests is discarded.
Related command
az loginDescription
Incorporate AzureAD/microsoft-authentication-library-for-python#575 and add
msal_telemetryfrom MSAL's response to Azure CLI's client telemetry. (Similar to howcore.allow_brokerconfiguration is added to client telemetry: #24304)Testing Guide
Then