question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Troubleshooting `VisualStudioCredential`

See original GitHub issue

Library name and version

Azure.Identity

Query/Question

I am reading this page: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/troubleshooting.md

(Which btw has broken links in this section)

And am looking under VisualStudioCredential. My Tools -> Options -> Azure Service Authentication is set with my Azure account. I have tried logging in and logging out (even clearing out the Identity folder/cache) but this still fails to work for me.

I am able to use environmental variables, so I have a workaround in the meantime. However it would be great to figure out what is going on here and perhaps add to the documentation to assist others that are running into the same issue.

Thank you for any assistance you can provide. 🙏

Environment

Windows 10 Visual Studio 2022 17.1 Preview 2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:35 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
Mike-E-angelocommented, May 10, 2022

OK! Pardon the confusion here @christothes I did try that earlier but apparently, I was running into some sort of state problem and/or needed to restart Visual Studio. I can now confirm that setting the AZURE_TENANT_ID along with setting the live.com account in Azure Service Authentication does in fact work as expected! All things considered, this is an acceptable workaround for me until further work is done on your end to formally select this property via the Azure Service Authentication interface.

My only remaining suggestion would be to consider updating the documentation to reflect this as a known issue along with this suggested workaround. Beyond that, as far as I am concerned, I am satisfied with this approach and will now take this issue off my nag list. 😇

Thank you very much for your patience and efforts out there. 🙏👍

1reaction
christothescommented, May 10, 2022

Hi @Mike-E-angelo Sorry for the delay - To your question about AZURE_TENANT_ID - if you are using DefaultAzureCredential, we should be pulling the TenantId from the environment as a default. Are you not seeing that behavior in your environment?

https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs#L36

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] DefaultAzureCredential VisualStudioCredential ...
Azure.Identity Client This issue points to a problem in the data-plane of the library. needs-author-feedback More information is needed from ...
Read more >
Troubleshoot Azure Identity authentication issues
Troubleshoot VisualStudioCredential authentication issues · In Visual Studio, select the Tools > Options menu to launch the Options dialog. · Navigate to the ......
Read more >
Azure Identity client library for .NET
A long-term fix to this problem is in progress. ... VisualStudioCredential, Authenticates in a development environment with Visual Studio.
Read more >
Azure.Identity.VisualStudioCredential with IIS appPoolIdentity
VisualStudioCredential cannot be used with ApplicationPoolIdentity on IIS. The pool must run under the developer's name. I ended up configuring ...
Read more >
VisualStudioCredential Class (Azure.Identity)
Enables authentication to Azure Active Directory using data from Visual Studio 2017 or later.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found