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

VS authentication fails with admin mismatch #193

Open
uecasm opened this issue Mar 8, 2023 · 0 comments
Open

VS authentication fails with admin mismatch #193

uecasm opened this issue Mar 8, 2023 · 0 comments

Comments

@uecasm
Copy link

uecasm commented Mar 8, 2023

I'm currently still using 2.0.18 (02845a3) so it's possible this is something resolved since then, but one weird behaviour I've noticed is the following.

When I have VS2022 running not as admin, and with the correct Azure credentials specified in its settings, running AzureSignTool also as non-admin works as expected.

When I have VS2022 running as admin, still with the correct Azure credentials specified in its settings, running AzureSignTool as non-admin fails with:

       ---> (Inner Exception #2) Azure.Identity.CredentialUnavailableException: Process "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\Asal\TokenService\Microsoft.Asal.TokenService.exe" has failed with unexpected error: TS003: Error, TS005: No accounts found.  Please go to Tools->Options->Azure Services Authentication, and add an account to be authenticated to Azure services during development..
       ---> System.InvalidOperationException: TS003: Error, TS005: No accounts found.  Please go to Tools->Options->Azure Services Authentication, and add an account to be authenticated to Azure services during development.
         at Azure.Identity.VisualStudioCredential.RunProcessesAsync(List`1 processStartInfos, Boolean async, CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at Azure.Identity.VisualStudioCredential.RunProcessesAsync(List`1 processStartInfos, Boolean async, CancellationToken cancellationToken)
         at Azure.Identity.VisualStudioCredential.GetTokenImplAsync(TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)
         at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex)
         at Azure.Identity.VisualStudioCredential.GetTokenImplAsync(TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)
         at Azure.Identity.VisualStudioCredential.GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken)
         at Azure.Identity.DefaultAzureCredential.GetTokenFromSourcesAsync(TokenCredential[] sources, TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)<---

When I have multiple instances of VS2022 open, it seems to matter which one was the first instance -- if I start an admin then a non-admin, it fails, then I close the admin (leaving only the non-admin) and start a new admin, and then it succeeds.

I haven't tested running AzureSignTool as admin as thoroughly, but it does seem like this always succeeds, even when the only VS instance is a non-admin one.


Edit: 4.0.1 (9f30f7a) has the same behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant