Skip to content

Commit e538d49

Browse files
authored
Merge pull request #76720 from mumian/0514-backup
[Azure Backup] create a new article
2 parents fb19036 + b6ffbea commit e538d49

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Azure Quickstart - Back up a VM with Resource Manager template
3+
description: Learn how to back up your virtual machines with Azure Resource Manager template
4+
services: backup
5+
author: rayne-wiselman
6+
manager: carmonm
7+
ms.service: backup
8+
ms.devlang: azurecli
9+
ms.topic: quickstart
10+
ms.date: 05/14/2019
11+
ms.author: raynew
12+
ms.custom: mvc
13+
---
14+
15+
# Back up a virtual machine in Azure with Resource Manager template
16+
17+
[Azure Backup](backup-overview.md) backs up on-premises machines and apps, and Azure VMs. This article shows you how to back up an Azure VM with Resource Manager template and Azure PowerShell. This quickstart focuses on the process of deploying a Resource Manager template to create a Recover Services vault. For more information on developing Resource Manager templates, see [Resource Manager documentation](/azure/azure-resource-manager/) and the [template reference](/azure/templates/microsoft.recoveryservices/allversions).
18+
19+
Alternatively, you can back up a VM using [Azure PowerShell](./quick-backup-vm-powershell.md), the [Azure CLI](quick-backup-vm-cli.md), or in the [Azure portal](quick-backup-vm-portal.md).
20+
21+
## Create a VM and Recovery Services vault
22+
23+
A [Recovery Services vault](backup-azure-recovery-services-vault-overview.md) is a logical container that stores backup data for protected resources, such as Azure VMs. When a backup job runs, it creates a recovery point inside the Recovery Services vault. You can then use one of these recovery points to restore data to a given point in time.
24+
25+
The template used in this quickstart is from [Azure quickstart templates](https://azure.microsoft.com/resources/templates/101-recovery-services-create-vm-and-configure-backup/). This template allows you to deploy simple Windows VM and Recovery Services Vault configured with the DefaultPolicy for Protection.
26+
27+
To deploy the template, select **Try it** to open the Azure Cloud shell, and then paste the following PowerShell script into the shell window. To paste the code, right-click the shell window and then select **Paste**.
28+
29+
```azurepowershell-interactive
30+
$projectName = Read-Host -Prompt "Enter a project name (limited to eight characters) that is used to generate Azure resource names"
31+
$location = Read-Host -Prompt "Enter the location (i.e. centralus)"
32+
$adminUsername = Read-Host -Prompt "Enter the administrator username for the virtual machine"
33+
$adminPassword = Read-Host -Prompt "Enter the administrator password for the virtual machine" -AsSecureString
34+
$dnsPrefix = Read-Host -Prompt "Enter the unique DNS Name for the Public IP used to access the virtual machine"
35+
36+
$resourceGroupName = "${projectName}rg"
37+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-recovery-services-create-vm-and-configure-backup/azuredeploy.json"
38+
39+
New-AzResourceGroup -Name $resourceGroupName -Location $location
40+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -projectName $projectName -adminUsername $adminUsername -adminPassword $adminPassword -dnsLabelPrefix $dnsPrefix
41+
```
42+
43+
Azure PowerShell is used to deploy the Resource Manager template in this quickstart. The [Azure portal](../azure-resource-manager/resource-group-template-deploy-portal.md), [Azure CLI](../azure-resource-manager/resource-group-template-deploy-cli.md), and [Rest API](../azure-resource-manager/resource-group-template-deploy-rest.md) can also be used to deploy templates.
44+
45+
## Start a backup job
46+
47+
The template creates a VM and enables back on the VM. After you deploy the template, you need to start a backup job. For more information, see [Start a backup job](./quick-backup-vm-powershell.md#start-a-backup-job).
48+
49+
## Monitor the backup job
50+
51+
To monitor the backup job, see [Monitor the backup job](./quick-backup-vm-powershell.md#monitor-the-backup-job).
52+
53+
## Clean up the deployment
54+
55+
If you no longer need to back up the VM, you can clean it up.
56+
57+
- If you want to try out restoring the VM, skip the clean up.
58+
- If you used an existing VM, you can skip the final [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) cmdlet to leave the resource group and VM in place.
59+
60+
Disable protection, remove the restore points and vault. Then delete the resource group and associated VM resources, as follows:
61+
62+
```powershell
63+
Disable-AzRecoveryServicesBackupProtection -Item $item -RemoveRecoveryPoints
64+
$vault = Get-AzRecoveryServicesVault -Name "myRecoveryServicesVault"
65+
Remove-AzRecoveryServicesVault -Vault $vault
66+
Remove-AzResourceGroup -Name "myResourceGroup"
67+
```
68+
69+
## Next steps
70+
71+
In this quickstart, you created a Recovery Services vault, enabled protection on a VM, and created the initial recovery point.
72+
73+
- [Learn how](tutorial-backup-vm-at-scale.md) to back up VMs in the Azure portal.
74+
- [Learn how](tutorial-restore-disk.md) to quickly restore a VM

articles/backup/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
href: quick-backup-vm-powershell.md
1414
- name: Back up a VM - CLI
1515
href: quick-backup-vm-cli.md
16+
- name: Back up a VM - Resource Manager template
17+
displayName: ARM
18+
href: quick-backup-vm-template.md
1619
- name: Tutorials
1720
items:
1821
- name: Back up Azure VMs at scale

0 commit comments

Comments
 (0)