@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 asindex.html
). If you already have one, you'll need to add rewrite rules. Make sure thisweb.config
file is part of your deployment package.
- You need to add a
- 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