title | description | services | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Create a Front Door with HTTP to HTTPS redirection using the Azure portal |
Learn how to create a Front Door with redirected traffic from HTTP to HTTPS using the Azure portal. |
front-door |
duongau |
frontdoor |
how-to |
09/30/2020 |
duau |
You can use the Azure portal to create a Front Door with a certificate for TLS termination. A routing rule is used to redirect HTTP traffic to HTTPS.
-
Sign in to the Azure portal at https://portal.azure.com.
-
Select Create a resource found on the upper left-hand corner of the Azure portal.
-
Search for Front Door using the search bar and once you find the resource type, select Create.
-
Choose a subscription and then either use an existing resource group or create a new one. Select Next to enter the configuration tab.
[!NOTE] The location asked in the UI is for the resource group only. Your Front Door configuration will get deployed across all of Azure Front Door's POP locations.
:::image type="content" source="./media/front-door-url-redirect/front-door-create-basics.png" alt-text="Configure basics for new Front Door":::
-
The configuration for Front Door happens in three steps - adding a default frontend host, adding backends in a backend pool and then creating routing rules to map the routing behavior for frontend host. Select the '+' icon on the Frontend hosts to create a frontend host.
:::image type="content" source="./media/front-door-url-redirect/front-door-designer.png" alt-text="Front Door configuration designer":::
-
Enter a globally unique name for your default frontend host for your Front Door. Select Add to continue to the next step.
:::image type="content" source="./media/front-door-url-redirect/front-door-create-frontend-host.png" alt-text="Add a frontend host":::
-
Select the '+' icon on the Backend pools to create a backend pool. Provide a name for the backend pool and then select Add a backend.
:::image type="content" source="./media/front-door-url-redirect/front-door-designer-backend-pool.png" alt-text="Front Door configuration designer backend pool":::
-
Select the Backend Host Type as App service. Select the subscription where your web app is hosted and then select the specific web app from the dropdown for Backend host name.
:::image type="content" source="./media/front-door-url-redirect/front-door-create-backend-pool.png" alt-text="Add a backend in a backend pool":::
-
Select Add to save the backend and select Add again to save the backend pool config.
-
Select the '+' icon on the Routing rules to create a route. Provide a name for the route, for example 'HttpToHttpsRedirect', and then set the Accepted Protocol field to 'HTTP only'. Ensure that the appropriate Frontend/domains is selected.
:::image type="content" source="./media/front-door-url-redirect/front-door-designer-routing-rule.png" alt-text="Front Door configuration designer routing rule":::
-
Under the Route Details section, set the Route Type to Redirect. Set the Redirect type to Moved (301) and Redirect protocol get set to HTTPS only.
:::image type="content" source="./media/front-door-url-redirect/front-door-redirect-config-example.png" alt-text="Add an HTTP to HTTPS redirect route":::
-
Select Add to save the routing rule for HTTP to HTTPS redirect.
-
Add another routing rule to handle the HTTPS traffic. Select the '+' sign on the Routing rules and provide a name for the route, for example 'DefaultForwardingRoute'. Then set the Accepted Protocols field to HTTPS only. Ensure that the appropriate Frontend/domains is selected.
-
On the Route Details section, set the Route Type to Forward. Ensure that the right backend pool gets selected and the Forwarding Protocol is set to HTTPS only.
:::image type="content" source="./media/front-door-url-redirect/front-door-forward-route-example.png" alt-text="Add a forward route for HTTPS traffic" border="false":::
-
Select Add to save the routing rule for request forwarding.
-
Select Review + create and then Create, to create your Front Door profile. Go to the resource once created.
[!NOTE] The creation of this redirect rule will incur a small charge.
- Learn how Front Door works.
- Learn more about URL redirect on Front Door.