0

I have an Angular SPA hosted in Static Web Site in Storage Account. The Azure Front Door is used to refer the Static Storage Web Site.

The base url of my SPA works with Front door url. However, the nested links gives me 404.

Example: https://xxx-int.com/onboard works However https://xxx-int.com/onboard/customer123/profile does not work. Note that here customer123 is a specific customerid.

I have configured one rule in AFD as below: If Request Url contains onboard/customer123 then redirect to /index.html

My question is: Is this a bad idea to mention entityIds in Urls? I followed Rest pricipals to form the route..where I am trying to access the profile of a specific customer.

0

I have tried configuring below rules in AFD:

If Request Url contains onboard/customer123 then Url Rewrite to match pattern /* and redirect to /index.html

See Front Door Rule Action config here

My question is: Is this a bad idea to mention entityIds in Urls? I followed Rest pricipals to form the route..where I am trying to access the profile of a specific customer.

1

There are 1 best solutions below

0
On

I created sample static website and used Azure front door to refer static website like below:

enter image description here

In front door -> Azure front door designer -> routing rule you can redirect the route type.

enter image description here

enter image description here

Refer this MsDoc and check this blog Configure URL Redirect on Azure Front Door - credits by Edi Wang

It is generally not recommended to include entityIds in URLs as it can expose sensitive information and make it easier for attackers to guess other entityIds. you can use unique identifiers.

In rewrite rule set add destination path used to replace the source pattern. If the request URL path is contoso.com/foo/1.jpg, the source pattern is /foo/, and the destination is /bar/, the content gets served from contoso.com/bar/1.jpg` from the origin.

Reference:

URL Rewrite - Azure Front Door | Microsoft Learn and So thread by Pirmin Rehm