Skip to content

Commit dafd49d

Browse files
authored
Merge pull request #248016 from TomArcherMsft/UserStory145919
User Story 145919
2 parents ca26bc0 + 1a9a3b3 commit dafd49d

File tree

2 files changed

+30
-47
lines changed

2 files changed

+30
-47
lines changed
797 KB
Loading
Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
---
2-
title: 'Quickstart: Create an Azure Front Door (classic) - Terraform'
2+
title: 'Quickstart: Create an Azure Front Door (classic) using Terraform'
33
description: This quickstart describes how to create an Azure Front Door Service 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 (classic) using Terraform
16+
# Quickstart: Create an Azure Front Door (classic) using Terraform
1517

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

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

20-
- [Terraform v1.3.2](https://releases.hashicorp.com/terraform/)
21-
- [AzureRM Provider v.3.27.0](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs)
22+
> [!div class="checklist"]
23+
> * Create a random value for the Azure resource group name using [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet).
24+
> * Create an Azure resource group using [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group).
25+
> * Create a random value for the Front Door endpoint host name using [random_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id).
26+
> * Create a Front Door (classic) resource using - [azurerm_frontdoor](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/frontdoor).
2227
2328
## Prerequisites
2429

@@ -28,29 +33,28 @@ The steps in this article were tested with the following Terraform and Terraform
2833

2934
## Implement the Terraform code
3035

36+
> [!NOTE]
37+
> 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-classic). 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-classic/TestRecord.md).
38+
>
39+
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
40+
3141
1. Create a directory in which to test the sample Terraform code and make it the current directory.
3242

3343
1. Create a file named `providers.tf` and insert the following code:
3444

35-
[!code-terraform[master](../../terraform/quickstart/101-front-door-classic/providers.tf)]
36-
37-
1. Create a file named `resource-group.tf` and insert the following code:
45+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-classic/providers.tf":::
3846

39-
47+
1. Create a file named `main.tf` and insert the following code:
4048

41-
1. Create a file named `front-door.tf` and insert the following code:
42-
43-
49+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-classic/main.tf":::
4450

4551
1. Create a file named `variables.tf` and insert the following code:
4652

47-
[!code-terraform[master](../../terraform/quickstart/101-front-door-classic/variables.tf)]
53+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-classic/variables.tf":::
4854

49-
1. Create a file named `terraform.tfvars` and insert the following code, being sure to update the value to your own backend hostname:
55+
1. Create a file named `outputs.tf` and insert the following code, being sure to update the value to your own backend hostname:
5056

51-
```terraform
52-
backend_address = "<your backend hostname>"
53-
```
57+
:::code language="Terraform" source="~/terraform_samples/quickstart/101-front-door-classic/outputs.tf":::
5458

5559
## Initialize Terraform
5660

@@ -66,37 +70,15 @@ The steps in this article were tested with the following Terraform and Terraform
6670

6771
## Verify the results
6872

69-
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
70-
71-
# [Portal](#tab/Portal)
72-
73-
1. Sign in to the [Azure portal](https://portal.azure.com).
74-
75-
1. Select **Resource groups** from the left pane.
76-
77-
1. Select the FrontDoor resource group.
73+
1. Get the Front Door endpoint:
7874

79-
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.
80-
81-
:::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.":::
82-
83-
# [Azure CLI](#tab/CLI)
84-
85-
Run the following command:
86-
87-
```azurecli-interactive
88-
az resource list --resource-group FrontDoor
89-
```
90-
91-
# [PowerShell](#tab/PowerShell)
92-
93-
Run the following command:
75+
```console
76+
terraform output -raw frontDoorEndpointHostName
77+
```
9478

95-
```azurepowershell-interactive
96-
Get-AzResource -ResourceGroupName FrontDoor
97-
```
79+
1. Paste the endpoint into a browser.
9880

99-
---
81+
:::image type="content" source="./media/quickstart-create-front-door-terraform/endpoint.png" alt-text="Screenshot of a successful connection to endpoint.":::
10082

10183
## Clean up resources
10284

@@ -108,4 +90,5 @@ Get-AzResource -ResourceGroupName FrontDoor
10890

10991
## Next steps
11092

111-
In this quickstart, you deployed a simple Front Door (classic) profile using Terraform. [Learn more about Azure Front Door.](front-door-overview.md)
93+
> [!div class="nextstepaction"]
94+
> [Overview of Azure Front Door](front-door-overview.md)

0 commit comments

Comments
 (0)