Azure Web App takes too long to log in users

Ford B 1 Reputation point

The issue I am having is very simple, my web app takes about two minutes to log in users after they enter their credentials and click "log in". The rest of the app works just fine and responds very quickly. According to the network tab of dev tools, the "waiting for server response" part of the fetch request initiated by my authService.js file is the part that takes so long. I apologize for the vagueness of this question, as I am a bit new to hosting a website on Azure and I am not exactly sure what is relevant and what isn't relevant to this issue. Please let me know if I can provide any more useful information that would help solve this issue. Thank you

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,209 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Carlos Solís Salazar 17,521 Reputation points MVP

    Hi @Ford B

    Thank you for asking this question on the **Microsoft Q&A Platform. **

    As you say, your question is vague, I'll recommend you do troubleshoot your App, you can:

    1. Enable diagnostics logging for apps in Azure App Service, this will help you get data on the functioning of your app.
    2. Enable Application Insights, if you require more data of your App, this is the right tool to monitor your application.

    By Activating these resources, you can get more information that can give you ode details about your app.

    Another DIY way is to run the code of your app locally and try to debug your app.

    First, try to run your code locally,

    Hope this helps!


    Accept Answer and Upvote, if any of the above helped, this thread can help others in the community looking for remediation for similar issues.
    NOTE: To answer you as quickly as possible, please mention me in your reply.

    0 comments No comments

  2. Bjoern Peters 8,856 Reputation points

    Hi @Ford B

    How should we know how your login process is designed, which steps were performed during a login attempt... where that information is stored?

    I could suggest through your tags that information may be stored in a SQL database...

    As Carlos stated above... with that logging, you could find more information about where this time is used/lost.

    Maybe you already have that information... where is your login function stopping/waiting... sending the request? waiting on a resultset from SQL? waiting on a connection to SQL? Working on the resultset?

    To answer your question in a better way, we need some more information from you about your application.

  3. Ford B 1 Reputation point

    I'm happy to report that I have solved the issue. @Bjoern Peters I'd like to thank you for all the questions you asked, specifically asking me about what exactly my authService.js file is doing, because it prompted me to look over the file very closely, and in doing so I noticed some details that didn't seem quite right. Basically, the url from which the token was being fetched was incorrect; it was trying to fetch the token from some service that we no longer use (I did not write this code, so that's why it's not correct or updated). I deleted the unnecessary parts of the url and tried to log in again and I was let in after less than 2 seconds. I'm aware that this seems a bit silly now, but I am new to this. Thank you again for your help and patience.

    For anyone having this issue in the future, despite the HTTP 500 error suggesting that it is a server issue, be sure to check the code that handles the log in/authentication process.

    0 comments No comments

  4. Marilee Turscak-MSFT 35,806 Reputation points Microsoft Employee

    Hi @Maranya, Damon ,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer. It may also make sense to accept the answer posted by @Bjoern Peters since his questions helped point you in the right direction.


    An Azure web app was taking about two minutes to log in users after they entered their credentials. According to the network tab of dev tools, the "waiting for server response" part of the fetch request initiated by my authService.js file was what was causing the delay.

    The URL from which the token was being fetched in the authService.js file was incorrect. It was trying to fetch the token from a deprecated service. After deleting the unnecessary parts of the URL, the login completed in less than two seconds. Others facing this issue in the future would be advised to check the code that handles the login/authentication process, even if there is an HTTP 500 error suggesting a server issue.


    If the information is an accurate representation of the resolution to this issue, please Accept the answer. This will help us and others in the community who may be researching similar issues.

    0 comments No comments