Skip to content

[Identity] Adjust log level for EnvCred warning - #31814

Merged
Paul Van Eck (pvaneck) merged 2 commits into
Azure:mainfrom
pvaneck:identity-env-client-id
Aug 29, 2023
Merged

Paul Van Eck (pvaneck) merged 2 commits into
Azure:mainfrom
pvaneck:identity-env-client-id

Conversation

@pvaneck

@pvaneck Paul Van Eck (pvaneck) commented Aug 25, 2023 •

Copy link
Copy Markdown
Member

If a possible environment credential is passed in, but no complete environment configuration is found, we output a warning log statement.

However, since the default log level is WARNING, this warning is always printed when a user is trying to use DefaultAzureCredential with the AZURE_CLIENT_ID envvar set (typically for using a user-assigned managed identity).

This warning is not printed with the WARNING prefix and can cause confusion for the user.

To address the most common case of this confusing users using DAC, the log level has been changed to INFO if the credential is detected to be within DAC.

Closes: #30214

@azure-sdk

Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

If a possible environment credential is passed in, but no complete
environment configuration is found, we output a warning log statement.

However, since the default log level is WARNING, this warning is always printed
when a user is trying to use DefaultAzureCredential with the AZURE_CLIENT_ID
envvar set (typically for using a user-assigned managed identity).

This warning is not printed with the `WARNING` prefix and can cause confusion
for the user.

Since setting AZURE_CLIENT_ID is a common use case outside of
EnvironmentCredential, the log level is relaxed to INFO if that's the
only environment config set.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
@pvaneck
Paul Van Eck (pvaneck) merged commit cdab548 into Azure:main Aug 29, 2023
@pvaneck
Paul Van Eck (pvaneck) deleted the identity-env-client-id branch August 29, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

UX issue when trying to use user assigned managed identity.

4 participants