Skip to content

Commit b4fdc30

Browse files
Update quick-backup-vm-terraform.md
1 parent 80caa4c commit b4fdc30

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

articles/backup/quick-backup-vm-terraform.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Quickstart: Back up a virtual machine in Azure with Terraform'
33
description: In this quickstart, you learn how to configure Azure Backup to run a backup on demand by creating and configuring an Azure Windows virtual machine, virtual network, subnet, public IP, network security group, network interface, storage account, Backup recovery services vault, and Backup policy.
44
ms.topic: quickstart
5-
ms.date: 04/02/2025
5+
ms.date: 04/03/2025
66
ms.custom: devx-track-terraform
77
ms.service: windows
88
author: jyothisuri
@@ -40,10 +40,7 @@ In this article, you learn how to:
4040

4141
## Implement the Terraform code
4242

43-
> [!NOTE]
44-
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-backup-vm). 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-backup-vm/TestRecord.md).
45-
>
46-
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform).
43+
The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-backup-vm). 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-backup-vm/TestRecord.md). See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform).
4744

4845
1. Create a directory in which to test and run the sample Terraform code, and make it the current directory.
4946

@@ -59,6 +56,13 @@ In this article, you learn how to:
5956
1. Create a file named `variables.tf`, and insert the following code:
6057
:::code language="Terraform" source="~/terraform_samples/quickstart/101-backup-vm/variables.tf":::
6158

59+
> [!IMPORTANT]
60+
> If you're using the 4.x azurerm provider, you must [explicitly specify the Azure subscription ID](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide#specifying-subscription-id-is-now-mandatory) to authenticate to Azure before running the Terraform commands.
61+
>
62+
> One way to specify the Azure subscription ID without putting it in the `providers` block is to specify the subscription ID in an environment variable named `ARM_SUBSCRIPTION_ID`.
63+
>
64+
> For more information, see the [Azure provider reference documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#argument-reference).
65+
6266
## Initialize Terraform
6367

6468
[!INCLUDE [terraform-init.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-init.md)]
@@ -73,8 +77,6 @@ In this article, you learn how to:
7377

7478
## Verify the results
7579

76-
### Azure CLI
77-
7880
1. Get the Azure resource group name.
7981

8082
```console
@@ -103,27 +105,14 @@ In this article, you learn how to:
103105
--backup-management-type AzureIaaSVM
104106
```
105107

106-
1. Run [`az backup job list`](/cli/azure/backup/job#az-backup-job-list) to monitor the backup job.
108+
1. Run [`az backup job list`](/cli/azure/backup/job#az-backup-job-list) to monitor the backup job. When the *Status* of the backup job reports *Completed*, your VM is protected with Backup recovery services and has a full recovery point stored.
107109

108110
```azurecli
109111
az backup job list --resource-group $resource_group_name \
110112
--vault-name $recovery_services_vault_name \
111113
--output table
112114
```
113115

114-
The output is similar to the following example, which shows the backup job is *InProgress*:
115-
116-
```output
117-
Name Operation Status Item Name Start Time UTC Duration
118-
-------- --------------- ---------- ----------- ------------------- --------------
119-
a0a8e5e6 Backup InProgress myvm 2017-09-19T03:09:21 0:00:48.718366
120-
fe5d0414 ConfigureBackup Completed myvm 2017-09-19T03:03:57 0:00:31.191807
121-
```
122-
123-
When the *Status* of the backup job reports *Completed*, your VM is protected with Backup recovery services and has a full recovery point stored.
124-
125-
---
126-
127116
## Clean up resources
128117

129118
[!INCLUDE [terraform-plan-destroy.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-plan-destroy.md)]

0 commit comments

Comments
 (0)