Utilize RegEx variable to minimize Rules within Azure Front Door Rule Sets

Nikola Oravec 20 Reputation points
2025-01-09T12:50:10.0166667+00:00

Is there a way to use RegEx in Azure FrontDoor Standard Subscription Rule Set, to extract a value lets say from a Request Header Accept-Language and use the extracted value in thr URL Rewrite Action to do some localization managing. For example: Accept-Language is "ja-JP" i write a regex to extract any supported languages lets say (en|es|fr|ja). Since "ja" is included in the header, I want to use that value in my URL Rewrite path, for example /gallery/letters/{lang}/writtenArticle.svg where {lang} is the value found in the provided regex. This can do so much good since currently every time I want to do some localization paths from lets say the CDN i have to write a seperate rule for each language. If I support 6 languages and I have let's say 20 images written in those 6 languages, i would need 6 x 20 = 120 rules. Instead of utilizing the variable extraction for the regex and using that, making only 20 rules that contain each supported language within. I hope what i wrote makes sense.

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
724 questions
{count} votes

Accepted answer
  1. Sai Prasanna Sinde 2,785 Reputation points Microsoft Vendor
    2025-01-09T23:24:02.8566667+00:00

    Hi @Nikola Oravec

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Please go through the following points:

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

    Thanks,

    Sai.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.