Skip to content

Commit f1c863f

Browse files
authored
Merge pull request #247904 from TomArcherMsft/UserStory145880
User Story 145880
2 parents dafd49d + dbef24e commit f1c863f

File tree

2 files changed

+36
-48
lines changed

2 files changed

+36
-48
lines changed
Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,70 @@
11
---
2-
title: 'Quickstart: Create an Azure Front Door Standard/Premium profile - Terraform'
2+
title: 'Quickstart: Create an Azure Front Door Standard/Premium profile using Terraform'
33
description: This quickstart describes how to create an Azure Front Door Standard/Premium using Terraform.
44
services: front-door
55
author: johndowns
66
ms.author: jodowns
7-
ms.date: 10/25/2022
7+
ms.date: 8/11/2023
88
ms.topic: quickstart
99
ms.service: frontdoor
1010
ms.workload: infrastructure-services
1111
ms.custom: devx-track-terraform
12+
content_well_notification:
13+
- AI-contribution
1214
---
1315

14-
# Create a Front Door Standard/Premium profile using Terraform
16+
# Quickstart: Create an Azure Front Door Standard/Premium profile using Terraform
1517

1618
This quickstart describes how to use Terraform to create a Front Door profile to set up high availability for a web endpoint.
1719

1820
[!INCLUDE [ddos-waf-recommendation](../../includes/ddos-waf-recommendation.md)]
1921

20-
The steps in this article were tested with the following Terraform and Terraform provider versions:
22+
In this article, you learn how to:
2123

22-
- [Terraform v1.3.2](https://releases.hashicorp.com/terraform/)
23-
- [AzureRM Provider v.3.27.0](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs)
24+
> [!div class="checklist"]
25+
> * Create a random value for the Azure resource group name using [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet).
26+
> * Create an Azure resource group using [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group).
27+
> * Create a random value for the Front Door endpoint resource name and App Service app name using [random_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id).
28+
> * Create a Front Door profile using [azurerm_cdn_frontdoor_profile](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_profile).
29+
> * Create a Front Door endpoint using [azurerm_cdn_frontdoor_endpoint](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_endpoint).
30+
> * Create a Front Door origin group using [azurerm_cdn_frontdoor_origin_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_origin_group)
31+
> * Create a Front Door origin, which refers to the App Service app, using [azurerm_cdn_frontdoor_origin](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_origin).
32+
> * Create a Front Door route using [azurerm_cdn_frontdoor_route](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_route).
33+
> * Create an App Service plan using [azurerm_service_plan](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan).
34+
> * Create an App Service app using [azurerm_windows_web_app](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app).
2435
2536
## Prerequisites
2637

27-
[!INCLUDE [open-source-devops-prereqs-azure-subscription.md](~/azure-dev-docs-pr/articles/includes/open-source-devops-prereqs-azure-subscription.md)]
28-
2938
- [Install and configure Terraform](/azure/developer/terraform/quickstart-configure)
30-
- IP address or FQDN of a website or web application.
3139

3240
## Implement the Terraform code
3341

42+
> [!NOTE]
43+
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-front-door-standard-premium). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/tree/master/quickstart/101-front-door-standard-premium/TestRecord.md).
44+
>
45+
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
46+
3447
1. Create a directory in which to test the sample Terraform code and make it the current directory.
3548

3649
1. Create a file named `providers.tf` and insert the following code:
3750

38-
[!code-terraform[master](../../terraform/quickstart/101-front-door-standard-premium/providers.tf)]
51+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-standard-premium/providers.tf":::
3952

40-
1. Create a file named `resource-group.tf` and insert the following code:
53+
1. Create a file named `main.tf` and insert the following code:
4154

42-
55+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-standard-premium/main.tf":::
4356

4457
1. Create a file named `app-service.tf` and insert the following code:
4558

46-
[!code-terraform[master](../../terraform/quickstart/101-front-door-standard-premium/app-service.tf)]
47-
48-
1. Create a file named `front-door.tf` and insert the following code:
49-
50-
59+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-standard-premium/app-service.tf":::
5160

5261
1. Create a file named `variables.tf` and insert the following code:
5362

54-
[!code-terraform[master](../../terraform/quickstart/101-front-door-standard-premium/variables.tf)]
63+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-standard-premium/variables.tf":::
5564

5665
1. Create a file named `outputs.tf` and insert the following code:
5766

58-
[!code-terraform[master](../../terraform/quickstart/101-front-door-standard-premium/outputs.tf)]
67+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-standard-premium/outputs.tf":::
5968

6069
## Initialize Terraform
6170

@@ -71,37 +80,15 @@ The steps in this article were tested with the following Terraform and Terraform
7180

7281
## Verify the results
7382

74-
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
75-
76-
# [Portal](#tab/Portal)
77-
78-
1. Sign in to the [Azure portal](https://portal.azure.com).
79-
80-
1. Select **Resource groups** from the left pane.
81-
82-
1. Select the FrontDoor resource group.
83+
1. Get the Front Door endpoint:
8384

84-
1. Select the Front Door you created 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.
85+
```console
86+
terraform output -raw frontDoorEndpointHostName
87+
```
8588

86-
:::image type="content" source="./media/create-front-door-bicep/front-door-bicep-web-app-origin-success.png" alt-text="Screenshot of the message: Your web app is running and waiting for your content.":::
89+
1. Paste the endpoint into a browser.
8790

88-
# [Azure CLI](#tab/CLI)
89-
90-
Run the following command:
91-
92-
```azurecli-interactive
93-
az resource list --resource-group FrontDoor
94-
```
95-
96-
# [PowerShell](#tab/PowerShell)
97-
98-
Run the following command:
99-
100-
```azurepowershell-interactive
101-
Get-AzResource -ResourceGroupName FrontDoor
102-
```
103-
104-
---
91+
:::image type="content" source="./media/create-front-door-terraform/endpoint.png" alt-text="Screenshot of a successful connection to endpoint.":::
10592

10693
## Clean up resources
10794

@@ -113,4 +100,5 @@ Get-AzResource -ResourceGroupName FrontDoor
113100

114101
## Next steps
115102

116-
In this quickstart, you deployed a simple Front Door profile using Terraform. [Learn more about Azure Front Door.](front-door-overview.md)
103+
> [!div class="nextstepaction"]
104+
> [Overview of Azure Front Door](front-door-overview.md)
66 KB
Loading

0 commit comments

Comments
 (0)