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.

[BUG] GetAccessTokenAsync is very slow when running locally

See original GitHub issue

Describe the bug I used GetAccessTokenAsync code to test MSI locally. The code was running for more than 1 minute before it returned a valid token. I tested it multiple times, the behavior was consistent.

Exception or Stack Trace Add the exception log and stack trace if available

To Reproduce Try running the code locally.

Code Snippet

namespace test
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var stopwatch = new Stopwatch();
            stopwatch.Start();

            var azureServiceTokenProvider = new AzureServiceTokenProvider();
            var token = await azureServiceTokenProvider.GetAccessTokenAsync("https://management.azure.com/");

            stopwatch.Stop();
            Console.WriteLine(stopwatch.Elapsed);
        }
    }
}

Expected behavior The method returns code in a reasonable time (e.g. a few seconds).

Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. iOS] Mac OS 10.13.6
  • IDE : [e.g. IntelliJ] VS code, tested locally using dotnet run.
  • Version of the Library used: Microsoft.Azure.Services.AppAuthentication, 1.0.3
  • Dotnet version: 2.2.103
  • Azure CLI version: 2.0.58

Additional context Add any other context about the problem here.

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jnyrupcommented, Jul 4, 2019

Do you know what is the connection string for Azure CLI?

"RunAs=Developer; DeveloperTool=AzureCli" https://docs.microsoft.com/en-us/azure/key-vault/service-to-service-authentication#connection-string-support

0reactions
omerlhcommented, Jul 16, 2019

Yes please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asp.net - Running sites on "localhost" is extremely slow
I'm using Firefox and the sites I'm testing run fine on other developers in my office's local machines / on the production server....
Read more >
PC very slow...…Running cleaning procedure that maybe ...
Hi, I have the habit to "clean" my PC by running CCleaner, Local Disk (C) Properties>Disk Cleanup and Check Scan.
Read more >
VS 2022 very laggy and slow : r/VisualStudio
I've just updated to VS 2022 from VS 2019 and it's very slow to use. Just moving the cursor around is laggy and...
Read more >
Roblox Studio very slow performance when window in focus
I'm having a very low framerate in Roblox Studio currently but only when the window is in focus. When it's in the background...
Read more >
The more we run locally, the Mendix gets slower
The run locally of the application under development is getting slower with each run locally. It takes about 5 minutes in the morning...
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