After updating the path location strategy in my Angular application, the URL redirects to the login page, but after logging in, the web content is not found in the Azure application URL.

BR 21 Reputation points
2025-03-26T11:47:59.99+00:00

After updating the path location strategy in my Angular application, the URL redirects to the login page, but after logging in, the web content is not found in the Azure application URL.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,674 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,001 Reputation points
    2025-04-03T22:28:09.57+00:00

    @BR what specific Azure service are you using to host your Angular application? ( App Service Windows, App Service Linux, etc)

    You may need to configure the Azure hosting platform to handle these deep links correctly.

    This allows your Angular application to load first. Once loaded, Angular's router takes over and correctly displays the component associated with the URL path (/dashboard in our example).

    How to Implement the Fix (Depends on Your Azure Hosting Service):

    Depending on where you're hosting your Angular app here how to fix it:

    • Azure App Service (Windows):
      • You need to add a web.config file to the root directory of your deployed Angular application (usually the same folder as index.html). If you already have one, you'll need to add rewrite rules. Make sure this web.config file is part of your deployment package.
    • Azure App Service (Linux - using Nginx/Apache):
      • You need to configure the web server's rewrite rules. How you do this depends on whether you're using a built-in image or a custom container.
      • You might need to provide a custom startup script or configuration file to apply these settings in App Service Linux.

    Hope that helps


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.