How to detach a OS disk?

jack 40 Reputation points
2025-05-22T02:09:17.09+00:00

I recently had to detach an data disk and that got me curious on how to detach an OS disk but found no documents on it. Just want to know in future case.
Thanks in advance

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,034 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vamsi Ram Annepu 915 Reputation points Microsoft External Staff Moderator
    2025-05-22T02:16:16.58+00:00

    Hi jack,

    an OS Disk can't be detached from a VM.

    The work around for it is you could export the OS Disk:

    • Stop/Deallocate the VM
    • Navigate to Disks and click on the OS Disk
    • Click on Disk Export and Generate URL - Depending on the size of the disk and the internet bandwidth you should extend the URL expiration time
    • Use the generated URL to start the download

    for more information and detailed explanation you can look into the below previous thread
    https://learn.microsoft.com/en-us/answers/questions/938670/how-to-deattach-an-os-disk
    https://learn.microsoft.com/en-us/answers/questions/1418887/how-to-detach-azure-vmss-os-disk
    https://learn.microsoft.com/en-us/answers/questions/2264013/how-to-reattach-an-os-disk-after-detaching-from-a

    Feel free to reach out if you have any further queries.

    If you found the information useful, please click "Accept answer" and "Upvote" on the post to let us know. 

    Thank You

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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