You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/quick-backup-vm-terraform.md
+10-21Lines changed: 10 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Quickstart: Back up a virtual machine in Azure with Terraform'
3
3
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.
4
4
ms.topic: quickstart
5
-
ms.date: 04/02/2025
5
+
ms.date: 04/03/2025
6
6
ms.custom: devx-track-terraform
7
7
ms.service: windows
8
8
author: jyothisuri
@@ -40,10 +40,7 @@ In this article, you learn how to:
40
40
41
41
## Implement the Terraform code
42
42
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).
47
44
48
45
1. Create a directory in which to test and run the sample Terraform code, and make it the current directory.
49
46
@@ -59,6 +56,13 @@ In this article, you learn how to:
59
56
1. Create a file named `variables.tf`, and insert the following code:
> 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).
@@ -73,8 +77,6 @@ In this article, you learn how to:
73
77
74
78
## Verify the results
75
79
76
-
### Azure CLI
77
-
78
80
1. Get the Azure resource group name.
79
81
80
82
```console
@@ -103,27 +105,14 @@ In this article, you learn how to:
103
105
--backup-management-type AzureIaaSVM
104
106
```
105
107
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.
107
109
108
110
```azurecli
109
111
az backup job list --resource-group $resource_group_name \
110
112
--vault-name $recovery_services_vault_name \
111
113
--output table
112
114
```
113
115
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
0 commit comments