An administrator needs to automate the backup configuration of a new virtual machine named `vm-hr-prod` running Windows Server 2025 in the `South Central US` region. The administrator has already installed the Azure PowerShell `Az` module.
The administrator must meet the following requirements:
1. Create a new Recovery Services Vault named `rsv-hr-prod` in the same region.
2. Set the vault context for the current PowerShell session.
3. Enable backup protection for `vm-hr-prod` using the default backup policy named `DefaultPolicy`.
4. Trigger an immediate, ad-hoc backup of `vm-hr-prod`.
Which sequence of PowerShell commands should the administrator execute? To answer, arrange the actions in the correct order.
- 1New-AzRecoveryServicesVault -Name "rsv-hr-prod" -ResourceGroupName "rg-hr" -Location "southcentralus"
- 2Set-AzRecoveryServicesVaultContext -Vault (Get-AzRecoveryServicesVault -Name "rsv-hr-prod" -ResourceGroupName "rg-hr")
- 3 policy
- 4 item
Cevap
The correct sequence of commands is: First, create the vault using New-AzRecoveryServicesVault. Second, set the vault context using Set-AzRecoveryServicesVaultContext. Third, retrieve the policy and enable backup using Get-AzRecoveryServicesBackupProtectionPolicy and Enable-AzRecoveryServicesBackupProtection. Fourth, retrieve the backup item and start the backup using Get-AzRecoveryServicesBackupItem and Backup-AzRecoveryServicesBackupItem.
The correct order establishes the prerequisite resources and session context before configuring backup policies and triggering backup actions. First, the Recovery Services Vault must be created. Second, the vault context must be set using Set-AzRecoveryServicesVaultContext so that subsequent backup commands know which vault to interact with. Third, the backup policy is retrieved, and backup protection is enabled for the VM. Finally, once the VM is protected, the backup item is retrieved, and an ad-hoc backup is executed.
Adım Adım Çözüm
Anahtar Kavram
Azure Virtual Machine Backup Configuration using Azure PowerShell
Tahmini Süre:2m 0s