|
| 1 | +--- |
| 2 | +title: 'Quickstart: Create an Azure Front Door Standard/Premium by using an Azure Resource Manager template (ARM template)' |
| 3 | +description: This quickstart describes how to create an Azure Front Door Standard/Premium by using Azure Resource Manager template (ARM template). |
| 4 | +services: front-door |
| 5 | +documentationcenter: |
| 6 | +author: duongau |
| 7 | +ms.author: duau |
| 8 | +editor: |
| 9 | +ms.date: 07/12/2022 |
| 10 | +ms.topic: quickstart |
| 11 | +ms.service: frontdoor |
| 12 | +ms.workload: infrastructure-services |
| 13 | +ms.tgt_pltfrm: na |
| 14 | +ms.custom: devx-track-azurepowershell, subject-armqs, mode-arm |
| 15 | +#Customer intent: As an IT admin, I want to direct user traffic to ensure high availability of web applications. |
| 16 | +--- |
| 17 | + |
| 18 | +# Quickstart: Create a Front Door Standard/Premium using an ARM template |
| 19 | + |
| 20 | +This quickstart describes how to use an Azure Resource Manager template (ARM Template) to create an Azure Front Door Standard/Premium with a Web App as origin |
| 21 | + |
| 22 | +[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)] |
| 23 | + |
| 24 | +If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template will open in the Azure portal. |
| 25 | + |
| 26 | +[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cdn%2Ffront-door-standard-premium-app-service-public%2Fazuredeploy.json) |
| 27 | + |
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +* If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin. |
| 31 | +* IP or FQDN of a website or web application. |
| 32 | + |
| 33 | +## Review the template |
| 34 | + |
| 35 | +The template used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/front-door-standard-premium-app-service-public/). |
| 36 | + |
| 37 | +In this quickstart, you'll create a Front Door Standard/Premium, an App Service, and configure the App Service to validate that traffic has come through the Front Door origin. |
| 38 | + |
| 39 | +:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.cdn/front-door-standard-premium-app-service-public/azuredeploy.json"::: |
| 40 | + |
| 41 | +One Azure resource is defined in the template: |
| 42 | + |
| 43 | +* [**Microsoft.Network/frontDoors**](/azure/templates/microsoft.network/frontDoors) |
| 44 | + |
| 45 | +## Deploy the template |
| 46 | + |
| 47 | +1. Select **Try it** from the following code block to open Azure Cloud Shell, and then follow the instructions to sign in to Azure. |
| 48 | + |
| 49 | +> [!NOTE] |
| 50 | +> If you want to deploy Azure Front Door Premium instead of Standard substitute the value of the sku parameter with `Premium_AzureFrontDoor`. For detailed comparison, view [Azure Front Door tier comparison](standard-premium/tier-comparison.md). |
| 51 | +
|
| 52 | + |
| 53 | +```azurepowershell-interactive |
| 54 | +$projectName = Read-Host -Prompt "Enter a project name that is used for generating resource names" |
| 55 | +$location = Read-Host -Prompt "Enter the location (i.e. centralus)" |
| 56 | +$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.cdn/front-door-standard-premium-app-service-public/azuredeploy.json" |
| 57 | +
|
| 58 | +$resourceGroupName = "${projectName}rg" |
| 59 | +
|
| 60 | +New-AzResourceGroup -Name $resourceGroupName -Location "$location" |
| 61 | +New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -frontDoorSkuName Standard_AzureFrontDoor |
| 62 | +
|
| 63 | +Read-Host -Prompt "Press [ENTER] to continue ..." |
| 64 | +``` |
| 65 | + |
| 66 | +Wait until you see the prompt from the console. |
| 67 | + |
| 68 | +2. Select **Copy** from the previous code block to copy the PowerShell script. |
| 69 | + |
| 70 | +3. Right-click the shell console pane and then select **Paste**. |
| 71 | + |
| 72 | +4. Enter the values. |
| 73 | + |
| 74 | + The template deployment creates a Front Door with a web app as origin |
| 75 | + |
| 76 | + The resource group name is the project name with **rg** appended. |
| 77 | + |
| 78 | + > [!NOTE] |
| 79 | + > **frontDoorName** needs to be a globally unique name in order for the template to deploy successfully. If deployment fails, start over with Step 1. |
| 80 | +
|
| 81 | + It takes a few minutes to deploy the template. When completed, the output is similar to: |
| 82 | + |
| 83 | + :::image type="content" source="./media/quickstart-create-front-door-template/front-door-standard-premium-template-deployment-powershell-output.png" alt-text="Front Door Resource Manager template PowerShell deployment output"::: |
| 84 | + |
| 85 | +Azure PowerShell is used to deploy the template. In addition to Azure PowerShell, you can also use the Azure portal, Azure CLI, and REST API. To learn other deployment methods, see [Deploy templates](../azure-resource-manager/templates/deploy-portal.md). |
| 86 | + |
| 87 | +## Validate the deployment |
| 88 | + |
| 89 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 90 | + |
| 91 | +2. Select **Resource groups** from the left pane. |
| 92 | + |
| 93 | +3. Select the resource group that you created in the previous section. The default resource group name is the project name with **rg** appended. |
| 94 | + |
| 95 | +4. Select the Front Door you created previously and you'll be able to see the endpoint hostname. Copy the hostname and paste it on to the address bar of a browser. Press enter and your request will automatically get routed to the web app. |
| 96 | + |
| 97 | + :::image type="content" source="./media/create-front-door-portal/front-door-web-app-origin-success.png" alt-text="Screenshot of the message: Your web app is running and waiting for your content."::: |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +## Clean up resources |
| 102 | + |
| 103 | +When you no longer need the Front Door service, delete the resource group. This will remove the Front Door and all the related resources. |
| 104 | + |
| 105 | +To delete the resource group, call the `Remove-AzResourceGroup` cmdlet: |
| 106 | + |
| 107 | +```azurepowershell-interactive |
| 108 | +Remove-AzResourceGroup -Name <your resource group name> |
| 109 | +``` |
| 110 | + |
| 111 | +## Next steps |
| 112 | + |
| 113 | +In this quickstart, you created a Front Door. |
| 114 | + |
| 115 | +To learn how to add a custom domain to your Front Door, continue to the Front Door tutorials. |
| 116 | + |
| 117 | +> [!div class="nextstepaction"] |
| 118 | +> [Front Door tutorials](front-door-custom-domain.md) |
0 commit comments