Search code examples
azureazure-front-door

Routing to multiple Web Apps behind Azure Front Door


I have two backend pools in my front door. One is configured for App Service AAA and the second one is configured for service BBB:

  • aaa.azurewebsites.net

  • bbb.azurewebsites.net

I'm adding two routing rules, one for backend pool AAA and the second one for backend pool BBB with the next patterns to match:

Backend pool AAA:

  1. /*
  2. /aaa/*

Backend pool BBB:

  1. /bbb/*

That's it for rules, so no Rules Engine configuration is set, Route Type is "Forward" and URL rewrite/Caching are disabled.

Now, I'm trying to access my backends:

  • fd.azurefd.net/web-method-of-aaa - it works and calls web method named "web-method-of-aaa" from backend aaa
  • fd.azurefd.net/aaa/web-method-of-aaa - returns 404
  • fd.azurefd.net/bbb/web-method-of-bbb - returns 404

What am I missing here? I've found one option, but it can't be used in my case because my Web Apps are deployed from Container Registry so I can't add virtual directory in the App Service.


Solution

  • So everything works if routing rules configured the next way:

    Rule for backend pool AAA:

    Patterns to match: /aaa/*
    URL Rewrite: enabled
    Custom forwarding path: /
    

    Rule for backend pool BBB:

    Patterns to match: /bbb/*
    URL Rewrite: enabled
    Custom forwarding path: /