How to properly route my app features in Front Door

53 Views Asked by At

I have a SaaS application available at *.myapp.com, "*" being the customer name (eg: "microsoft.myapp.com" for Microsoft's account).

Currently this app is 1 mere app service set behind Front Door (Classic), but we want to split it in 2, to separate the frontend and the API calls for performance reasons. So the plan is the following on Front Door :

enter image description here

The rules determine where the traffic goes through the URL :

  • Starts with « /api/ » => forward to the API app service
  • Everything else => forward to the frontend app service

enter image description here

The DNS has of course the following record :

*.myapp.com CNAME myFrontDoor.azurefd.net.

This setup generates a 404 error when trying to access existingcustomer.myapp.com.

enter image description here

From the error itself I understand that I must declare the domain name in the app service itself (which make very little sense to me because the domain name redirects to Front Door and Front Door is meant to redirect to a known Azure resource).

So I do it for the frontend app service and it works !

enter image description here

enter image description here

But when I go to the API app service to replicate the domain name setting, I get the following error :

enter image description here

Validation failed. Hostname '*.myapp.com' conflicts with an already existing hostname. Conflicting app resource ID: /subscriptions/[guid]/resourceGroups/[rg]/providers/Microsoft.Web/sites/app-myapp-frontend.

I'm totally confused, the feature seams to force a setting which makes it unusable. What am I missing ? Thank you for your help !

0

There are 0 best solutions below