Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TomArcherMsft authored Nov 25, 2024
1 parent a78f6fb commit 70d2bae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quickstart/101-backup-vm/readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Azure Backup VM

[Azure Backup](https://learn.microsoft.com/azure/backup/) backs up on-premises machines and apps, and Azure VMs. This sample shows how to use Terraform to create a Windows VM and back it up using a Recovery Services vault.
[Azure Backup](https://learn.microsoft.com/azure/backup/) backs up on-premises machines and apps, and Azure VMs. This sample shows how to use Terraform to create a Windows VM and back it up using a Recovery Services Vault.

## Code explanation

So that you can run the code multiple times without naming collisions, the code starts by creating a randomly named resource group. In addition, a random string of 12 lowercase letters is generated that is used to name the other resource: virtual network, subnet, public IP, network security group, network interface, storage account, and Windows virtual machine. The network security group includes rules for allowing inbound RDP and web traffic. The network interface is associated with the subnet and the public IP, and it is also associated with the network security group. The storage account is used for boot diagnostics for the virtual machine. The virtual machine is a Windows machine, and it is associated with the network interface. A random password is generated for the admin user of the virtual machine. A Recovery Services Vault is created, along with a backup policy for daily backups with a retention period of 7 days. Finally, the virtual machine is protected by associating it with the backup policy. Note that a variable named `soft_delete_enabled` allows you to specify whether *soft delete* is enabled for the recovery services vault. For more information about this and other Recovery Services Vault attributes, see the reference documentation for [azurerm_recovery_services_vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/recovery_services_vault.html).
So that you can run the code multiple times without naming collisions, the code starts by creating a randomly named resource group. In addition, a random string of 12 lowercase letters is generated that is used to name the other resource: virtual network, subnet, public IP, network security group, network interface, storage account, and Windows virtual machine. The network security group includes rules for allowing inbound RDP and web traffic. The network interface is associated with the subnet and the public IP, and it is also associated with the network security group. The storage account is used for boot diagnostics for the virtual machine. The virtual machine is a Windows machine, and it is associated with the network interface. A random password is generated for the admin user of the virtual machine. A Recovery Services Vault is created, along with a backup policy for daily backups with a retention period of 7 days. Finally, the virtual machine is protected by associating it with the backup policy. Note that a variable named `soft_delete_enabled` allows you to specify whether *soft delete* is enabled for the Recovery Services Vault. For more information about this and other Recovery Services Vault attributes, see the reference documentation for [azurerm_recovery_services_vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/recovery_services_vault.html).

## Resources

Expand Down

0 comments on commit 70d2bae

Please sign in to comment.