This PR fixes up the AzureauthCliCredential with a few changes:
The credential only builds behind feature flag azureauth_cli, but this was accidentally used in code with a dash (-) rather than a underscore (_). This is updated.
The TokenCache was added as a more internal means of in-memory token caching, but the updates made to AzureauthCliCredential didn't build.
The TokenCredential trait was updated, so we update the implementation for AzureauthCliCredential.
Checking the version of AzureAuth before attempting to get an access token is slow, and doubles the time it takes to get your token which impacts developer command line tools quite a lot (anywhere from 600ms-2Kms). Switch from trying to use azureauth --version to using which azureauth.exe and fall back to azureauth.
To ensure this all works I've added a corresponding example similar to the azure cli example. This example doesn't hardcode a client or tenant, only the AzureDevops Application ID (the default scope).
I've built and ran the example CLI confirming the azureauth usage works on the following platforms:
This PR fixes up the
AzureauthCliCredential
with a few changes:azureauth_cli
, but this was accidentally used in code with a dash (-
) rather than a underscore (_
). This is updated.TokenCache
was added as a more internal means of in-memory token caching, but the updates made toAzureauthCliCredential
didn't build.TokenCredential
trait was updated, so we update the implementation forAzureauthCliCredential
.azureauth --version
to usingwhich azureauth.exe
and fall back toazureauth
.I've built and ran the example CLI confirming the azureauth usage works on the following platforms: