Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUERY] Log what DefaultAzureCredential picks up (managed identity or env vars) #6591

Closed
snobu opened this issue Nov 30, 2019 · 8 comments
Closed
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization.
Milestone

Comments

@snobu
Copy link
Member

snobu commented Nov 30, 2019

Is there a way to tell what type of credentials (env vars/managed identity) is DefaultAzureCredential using?

I would like to log something along these lines:

[Info] Using Managed Identity to acquire an access token.

or

[Info] Using Environment Variables (service principal) to acquire an access token.

after calling

DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build();
@snobu snobu changed the title Log what DefaultAzureCredentials picks up (managed identity or env vars) [QUERY] Log what DefaultAzureCredentials picks up (managed identity or env vars) Nov 30, 2019
@snobu snobu changed the title [QUERY] Log what DefaultAzureCredentials picks up (managed identity or env vars) [QUERY] Log what DefaultAzureCredential picks up (managed identity or env vars) Nov 30, 2019
@jongio
Copy link
Member

jongio commented Nov 30, 2019

See Azure/azure-sdk-for-net#8948 for example of how to get this with AzureEventSourceListener. I will get a sample in Java soon.

@snobu
Copy link
Member Author

snobu commented Dec 1, 2019

I'm unable to find AzureEventSourceListener type in the Java SDK. A sample would be highly appreciated!

@jongio
Copy link
Member

jongio commented Dec 4, 2019

Sorry for the delay @snobu I'm still looking into this. (Java is not my primary language, so reaching out to some folks)

@snobu
Copy link
Member Author

snobu commented Dec 4, 2019

No worries, Jon. I believe this would make a good addition to the SDK samples once out. It will definitely help with debugging sessions primarily, development as well and those Learning in production moments we all cherish.

@joshfree joshfree added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Dec 10, 2019
@joshfree joshfree added this to the [2020] February milestone Dec 10, 2019
@joshfree
Copy link
Member

/cc @catalinaperalta

@jianghaolu
Copy link
Contributor

Just a quick update we are having a cross-language overhaul for our logging mechanisms including addressing this need. I'll update here when a PR is open and community review is welcomed.

@jianghaolu jianghaolu modified the milestones: [2020] April, [2020] May Apr 7, 2020
@snobu
Copy link
Member Author

snobu commented Apr 7, 2020

Sounds great! Appreciate the update.

@jianghaolu
Copy link
Contributor

this feature has been merged in #12268

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

No branches or pull requests

5 participants