Restoring Ransomware-Infected Azure VMs Safely
Short answer
C You should restore the VM to a new Azure VM to ensure a clean, isolated environment free from ransomware contamination.
Question
One of the VMs is backed up every day using Azure Backup Instant Restore.
When the VM becomes infected with data encrypting ransomware, you are required to restore the VM.
Which of the following actions should you take?
Key Takeaways
The main trap is thinking you can overwrite the infected VM; the correct approach isolates the threat by creating a fresh, clean VM.
Learn why restoring a ransomware-infected Azure VM to a new instance is the correct security practice over overwriting existing resources.
Common mistake: Option A is incorrect because simply deleting the infected VM doesn't address how to safely bring data back online without risking reinfection from contaminated backups or persistent threats. Option B is dangerous as it assumes other VMs in the subscription are safe, which may not be true after a ransomware event.
Expert Analysis
The core concept here is the security boundary between a compromised environment and a restored one. When an Azure VM is infected with ransomware, the immediate priority is containment. Restoring to the same infrastructure or an existing VM (Option B) risks re-infection if the backup points are also contaminated or if lateral movement has occurred within the subscription. Option A suggests deleting first, which is part of the isolation process, but the critical action for restoration is ensuring the target is clean.
Azure Backup Instant Restore allows you to restore files directly to a new VM without restoring the entire disk image, providing a quick recovery path. The best practice for ransomware recovery is to spin up a new Azure VM (Option C). This creates an isolated, uncontaminated environment. You can then attach the restored disks or copy files from the instant restore point. This ensures that any remnants of the malware on the original VM do not persist in the restored system. Restoring to an on-premise device (Option D) is generally not feasible for Azure VMs due to network and licensing complexities, and restores to existing VMs (Option B) violate the principle of separation of concerns during incident response.
Exam Strategy
When dealing with incident response scenarios in AZ-104, always prioritize isolation and cleanliness. If a resource is compromised, look for options that involve creating new, isolated instances rather than modifying or overwriting existing ones. This applies to VMs, databases, and storage accounts alike.
Frequently Asked Questions
Why can't I restore the infected VM to itself?
What is Azure Backup Instant Restore?
Community Votes
88% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 106 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 106
-
Zokko 👍 38I belive it is the C option A - If you delete the VM you cannot recover to that vm it must exist B - You do not know the other VMs C - Creating a New VM you can recover the VM D - You can recover from the backup https://docs.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms
-
hz78 👍 19The correct answer is C. You should restore the VM to a new Azure VM. In the scenario where a VM is infected with ransomware, it's best practice to isolate and remove the infected VM from the network as soon as possible. Once the infected VM has been isolated and deleted, you can initiate a restore process using Azure Backup Instant Restore. The restore process should create a new VM with the restored data. Option A is incorrect because restoring data to the same VM is not recommended if it was infected with ransomware. The restore process should create a new VM with the restored data. Option B is incorrect because you can't restore a VM to any VM within the company's subscription. You can only restore a VM to the original VM or a new Azure VM. Option D is also incorrect because Azure Backup is a cloud-based backup solution, and it doesn't support restoring VMs to on-premise Windows devices.
-
lchikoore 👍 10C. You should restore the VM to a new Azure VM. Explanation: Restoring the VM after deleting the infected VM (Option A) could result in the restoration of the ransomware-infected files and potentially lead to further compromise if the infection has spread to other parts of the VM or its backups. Restoring the VM to any VM within the company's subscription (Option B) without taking necessary security precautions may allow the ransomware to persist and potentially impact other systems within the subscription. Restoring the VM to a new Azure VM (Option C) is the recommended approach as it ensures a clean and isolated environment. By creating a new Azure VM, you can ensure that the restored VM is free from any ransomware infections. Restoring the VM to an on-premise Windows device (Option D) might introduce risks to the local environment if the on-premises device is not properly secured or if the restore process inadvertently transfers the ransomware or its encrypted files
-
J4U 👍 10Yes, VM can be restored by replacing the existing disk or in a new VM.
-
Leunis 👍 9 Answered CThere are two variants of this question. - Recovering only the files, you can recover them to any other VM within the company. - Using instant recover to recover the entire VM, this should be done to a new VM.
Show 25 more comments
-
ggogel 👍 8"A - If you delete the VM you cannot recover to that vm it must exist" This is not correct. As described in your link, you cannot use the option "replace existing" after the VM was deleted. The backup is not linked to the existence of the VM! What kind of backup would this be that gets deleted when the original VM gets deleted?! In my opinion, A and C would work just fine. I would even argue that A is the saver option. Firstly, we get rid of the ransomware such that it cannot infect any other systems. Secondly, we prevent any overlaps in hostname / IP configuration between the new and old VM.
-
j777 👍 8I want to give an analogy that maybe some would better understand. when you change the oil in your car you simply dn't reuse the same oil. You want to make sure you use brand new oil. In this case why would you want to use the same VM? that would not make sense one should ALWAYS use a new VM after ransomeware attack.
-
Tukarammane 👍 6 Answered CANS C ==
-
Rednevi 👍 5 Answered CC. You should restore the VM to a new Azure VM. In the event of a ransomware infection on an Azure VM that is backed up using Azure Backup Instant Restore, it's generally recommended to restore the VM to a new Azure VM. This ensures that you are not using the compromised VM, and you can have confidence that the new VM is clean and unaffected by the ransomware. Option A (restoring after deleting the infected VM) could be risky because the compromised VM might still be accessible and could potentially re-infect the new VM. Option B (restoring to any VM within the company's subscription) is possible, but restoring to a new Azure VM is a safer approach. Option D (restoring to an on-premise Windows device) would not be relevant for restoring an Azure VM.
-
3c5adce 👍 5Answer C (You should restore the VM to a new Azure VM) is a better choice. This approach ensures you're working with a completely uncontaminated, fresh environment, thereby significantly reducing the risk of any remnants of the ransomware affecting your new setup. However, it should be noted that this option should ideally be combined with the deletion of the infected VM (A) to mitigate any risk of spreading the ransomware further. This isn't explicitly mentioned in option C but is a critical step in the recovery process. So, while C is the better answer among the provided options for where to restore the VM, ensure to first delete the infected VM as a preparatory step.
-
Mazinger 👍 5 Answered CC. You should restore the VM to a new Azure VM. In the scenario where a virtual machine is infected with ransomware, it is important to isolate the compromised virtual machine to prevent the spread of the ransomware. Restoring the virtual machine after deleting the infected VM is not recommended, as it is possible that the backup of the infected VM may also be compromised. The recommended approach is to restore the VM to a new VM, as this provides a clean environment that is not compromised by the ransomware. Additionally, restoring the VM to an on-premises Windows device is not recommended since this may compromise the device as well.
-
basanta123 👍 5 Answered Ci explain in easy way. When a VM is infected with ransomware, you should not restore the VM to the infected VM. This is because the ransomware will still be present on the VM, and it will encrypt the files again. You should also not restore the VM to any VM within the company's subscription. This is because the ransomware could spread to other VMs in the subscription. The best way to restore a VM that is infected with ransomware is to restore it to a new Azure VM. This will ensure that the ransomware is not present on the new VM.
-
Osmoziz 👍 5 Answered CC
-
Timock 👍 4Answer: Create a new VM Create a new VM: Quickly creates and gets a basic VM up and running from a restore point. Restore disk: Restores a VM disk, which can then be used to create a new VM. Both of these options state creating a new VM and either doing it directly or attaching a restored VM disk. You could use an existing VM as well but that VM is probably already being used for something else. In the other question in this series it states what is TRUE and they are saying you can ONLY recover to specified locations which is not correct. In this answer it states SHOULD. You should use a new VM. Replace existing: The current VM must exist. If it's been deleted, this option can't be used. https://docs.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms
-
jellybiscuit 👍 4Answer: C You can restore and overwrite the existing machine, M$ calls this "replace existing" (not an option given) or restore to a new VM. https://docs.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms
-
whothe6 👍 4 Answered BI think the only game here is that the option B. clarify that is in the same subscription. Option C. says to a new VM but if it's on another subscription you will not be able to restore.
-
anand_3555 👍 4B is wrong. you can only backup to the same VM (restore) or to a new VM. answer should be C
-
JannisJannisJannis 👍 4Most of the time it is better to go with the most voted answers.
-
GiJoe1987 👍 4Answer should be C - Create new vm from the backups
-
kidacad 👍 3 Answered CAnswer is "C" Here, we talk about "VM recover" ( not Files recover ) So, we need to recover all the VM ( "create new VM" Functionality ), as this docs : https://azure.microsoft.com/en-us/blog/an-easy-way-to-bring-back-your-azure-vm-with-in-place-restore/ Compare to the "Files recover", where the IN-PLACE limitation is "on the original VM" as this docs : https://azure.microsoft.com/en-us/blog/instantly-restore-your-azure-virtual-machines-using-azure-backup/
-
Saravana12g 👍 3Answer should be B. For restoring a VM, you can choose 'Create new' or 'Replace existing' options. Hence the nearest answer would be B. It can't be C. because in C, it just infers we need to use NEW VM and doesn't tell about using existing VM.
-
Cantero75 👍 3Is B, you should restore the vm into a machine in the subscription, that means, that you can create a new vm, into the subscription and recover the vm there, you cannot do it, in a new vm that don't belong to that subscription.
-
sjb666 👍 3C. Can't be 'replace existing' as it's encrypted with malware (Replace existing option is currently supported for unencrypted managed VMs. )
-
Karl2guru 👍 3Answer is B... This inmplies you should restore the VM to any VM so implies even create and restore to a new one too!!
-
NaoVaz 👍 3 Answered CTo restore a full VM we should create a new VM before deleting the infected one.
-
ertin74 👍 3 Answered AA: delete the infected VM, restore an healthy state of the VM.
-
alen995454 👍 3 Answered CC. You should restore the VM to a new Azure VM
-
MikeRodriguez 👍 3Q41 is about recovering files, not the vm
-
lokii9980 👍 2C. You should restore the VM to a new Azure VM. In this scenario, since the VM has been infected with data encrypting ransomware, it is recommended to restore the VM to a new Azure VM, rather than restoring it to the infected VM. This is because restoring the VM to the same VM could potentially result in the restored files being encrypted again. To restore the VM to a new Azure VM, you can use Azure Backup Instant Restore. This feature allows you to restore files and folders from a recovery point directly to a new VM. You can then use the newly restored VM and verify that the files are not infected. Therefore, the correct answer is C. You should restore the VM to a new Azure VM.
-
khamrumunnu 👍 2 Answered CAnswer is C Why other options are incorrect: A. Restore after deleting the infected VM → Risky. You might lose reference data (like VM ID or associated configurations). Better to restore to a new VM first and then clean up the old one. B. Restore the VM to any VM → You can recover files to another VM, but not the entire VM. This is not suitable in a ransomware recovery situation where the whole system needs to be replaced. D. Restore to an on-premise Windows device → Azure VM full restore is designed for restoring in Azure, not on-premises (though file-level recovery can be downloaded locally, that's not relevant here).
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AZ-104 Questions
Access 100 questions with complete answers and detailed explanations.
View Full AZ-104 Practice Test →