Share via

Golden image VM recovery from Azure compute gallery

Joshi, Sunil (CyberTech) 0 Reputation points
2026-03-04T11:51:57.71+00:00

During our cleanup activity we have accidentally deleted one of the golden image from Azure compute gallery. and unfortunately we don't have any data backup and soft deletion option is not enabled. so we would like to recover the image.

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

{count} votes

2 answers

Sort by: Most helpful
  1. Himanshu Shekhar 4,025 Reputation points Microsoft External Staff Moderator
    2026-03-04T15:31:06.8766667+00:00

    Joshi, Sunil (CyberTech) The golden image was deleted from the Azure Compute Gallery while Soft Delete was not enabled and no backup (snapshot/export) exists. In this case, the deletion is considered a hard delete, and Azure does not support recovery of Compute Gallery images once permanently deleted. Unfortunately, Microsoft is unable to restore the image after deletion when Soft Delete was not enabled at the time of deletion.

    This behavior is by design and documented by Microsoft.

    Next steps / recommendations:

    1. Recreate the golden image from an existing VM, OS disk, or managed disk snapshot (if any VM was created earlier using this image).
    2. Re‑publish the recreated image to Azure Compute Gallery.
    3. Enable Soft Delete on the Compute Gallery to protect against accidental deletions going forward (provides a 7‑day recovery window).
    4. Implement image backup best practices (disk snapshots / VHD exports) and restrict delete permissions using RBAC.

    Microsoft documentation:

    1. Soft Delete in Azure Compute Gallery: https://learn.microsoft.com/azure/virtual-machines/soft-delete-gallery
    2. Azure Compute Gallery overview: https://learn.microsoft.com/azure/virtual-machines/azure-compute-gallery
    0 comments No comments

  2. Q&A Assist
    2026-03-04T11:52:08.1266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    If Soft Delete was not enabled on the Azure Compute Gallery at the time the golden image was deleted, the image version is permanently removed and cannot be recovered through the Soft Delete mechanism.

    Soft Delete for Azure Compute Gallery images only works when:

    • The gallery has the Soft Delete feature registered and enabled in advance, and
    • The image is deleted after Soft Delete is active, so it moves into a soft-deleted state and remains recoverable for up to seven days.

    In the current scenario:

    • With Soft Delete not enabled, the deleted image never entered the soft-deleted state, so there is no 7‑day recovery window and no supported platform method to restore that image version.
    • The documented recovery flow (listing soft-deleted images and using Undelete or the corresponding REST PUT call) applies only to images that are already in the soft-deleted state.

    Going forward, the only options are:

    1. Recreate the golden image from whatever original source or build process produced it (for example, from a base VM, VHD, or configuration scripts).
    2. Enable Soft Delete on the Azure Compute Gallery so that any future deletions of images can be recovered within the 7‑day retention period.

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.