Azure Front Door and CDN profiles http to https redirection rule

Anonymous
2023-01-10T00:37:23.467+00:00

I have created an Azure Front Door Standard and set the domain and SSL and it correctly handles the traffic in front of my App Service. I can't get the http to https redirection rule working though and i cannot seem to find an updated Documentation page for this version of Front Door.

For now i have created a Rule set with just one rule
277671-image.png

I have also associated the rule to my route which only accepts HTTPS requests. After waiting for 20 minutes for it to propagate though i still get a Microsoft 404 Page not found. What am i missing here?

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

Accepted answer
  1. KapilAnanth-MSFT 49,616 Reputation points Microsoft Employee Moderator
    2023-01-10T06:09:19.217+00:00

    Hi @Anonymous ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well. I understand that you would like to configure HTTP to HTTPS redirection in AFD Standard.

    Redirecting all Traffic to HTTPS can now be done in the EndPoint's Routes. Refer: Configure an Azure Front Door Standard/Premium Route

    277706-image.png

    This should automatically redirect all HTTP Requests to HTTPS.

    The RuleSet which you have shared seems correct only.

    I see you have mentioned, "I have also associated the rule to my route which only accepts HTTPS requests". But shouldn't you attach this to the Route that accepts HTTP traffic and not HTTPS?

    You can either use the Redirect in the Route or you can use the Rules in the HTTP Route Please let me know if the above helps or you need more info.

    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.


1 additional answer

Sort by: Most helpful
  1. Luke Murray 11,436 Reputation points MVP Volunteer Moderator
    2023-01-10T01:17:00.667+00:00

    Have a look at Sam's blog here: https://samcogan.com/forcing-https-with-azure-front-door-rules/

    277628-image.png

    Then assign the rule:

    Assign Rule
    Currently, our rule won’t do anything as we haven’t assigned it to a Route in Front Door. To assign the rule, we can go to the Front Door designer and locate the route where we want the rule applied. In the Route Details section, you should see a “Rules Engine configuration” drop-down where you can select the rule you created.

    Assign rule

    1 person found this answer 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.