Azure Application Gateway path based wildcard rule issue

Souvik Saha Choudhary 21 Reputation points
2024-09-03T07:54:53.87+00:00

We have the path-based rule in Azure Application Gateway to forward requests for dev number-specific requests to the specific backend pool. It’s working perfectly with the following scenarios:

/devXYZ/*

/admin/devXYZ/*

But when a request is for some admin modules, the requests are forwarded to the default backend pool. For example:

/admin/preferences/devXYZ/emailRules

/admin/settings/devXYZ/emailSettings/index

How can we forward these kind of requests to the specific backend pool?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,048 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 44,311 Reputation points Microsoft Employee
    2024-09-03T10:42:10.44+00:00

    @Souvik Saha Choudhary ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    From your verbatim,

    • I see you have multiple backend pools
    • And you have a requirement to route the following paths to a specific backend
      • /admin/preferences/devXYZ/emailRules
      • /admin/settings/devXYZ/emailSettings/index

    Solution :

    • You can use "/admin/*" - if this uses the same backendpool as "/admin/devXYZ/*"
      • i.e., "/admin/devXYZ/*" will be contained by the generic rule "/admin/*"
      • You can just remove "/admin/devXYZ/*"
    • You can still use "/admin/*" - even if this uses a different backendpool than "/admin/devXYZ/*"
      • You can achieve this by changing the order of the rules
      • Make sure "/admin/devXYZ/*" is above the path "/admin/*"
      • This way, "/admin/devXYZ/*" will be processed first and requests to this backend will be correctly routed
      • Generic paths matching with "/admin/*" will be processed only if the above fails (and is sent to a different backend pool as configured)

    You can find a list of supported PathPatterns and more info on this here

    • Each path must start with / and may use * as a wildcard character.
    • If used, from the examples, I see the wildcard should not be followed by any more characters.

    Path rules are processed in order, based on how they're listed in the portal. The least specific path (with wildcards) should be at the end of the list, so that it will be processed last. If wildcard rules are present at the top of the list, they take priority and will be processed first. See the following example scenarios.

    Kindly let us know if this helps or you need further assistance on this issue.

    Thanks,

    Kapil


    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.


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.