Review Azure VM migration to managed disks

Migrate retired unmanaged disks to managed disks and verify recovery procedures.

Description

Azure unmanaged disks were retired on March 31, 2026. VMs that use them cannot start, and running VMs are subject to stopping and deallocation. Migrate to managed disks while separately managing backups, access permissions and recovery settings.

Potential impact

  • Dependence on retired unmanaged disks can disrupt VM availability and recovery.
  • Changing existing VHD references without planning can cause disk replacement or data loss.

Remediation

  • Follow the official unmanaged-disk migration procedure, first confirming backups and data recovery. Plan required downtime and Terraform state/resource changes.
  • Migrate to managed disks suited to the existing VM and data, then verify boot and application operation. Configure appropriate performance, backups and access controls.

Examples

These historical excerpts compare disk types on the legacy azurerm_virtual_machine resource. The unmanaged-disk example is not for new deployment. Replacing properties does not automatically migrate an existing VHD; OS-image and authentication settings are omitted.

Before

hcl
resource "azurerm_virtual_machine" "example" {
  name                  = "${var.prefix}-vm"
  location              = azurerm_resource_group.example.location
  resource_group_name   = azurerm_resource_group.example.name
  network_interface_ids = [azurerm_network_interface.main.id]
  vm_size               = "Standard_DS1_v2"

  storage_os_disk {
    name          = "myosdisk1"
    create_option = "FromImage"
    vhd_uri       = "https://<storageaccount>.blob.core.windows.net/<container>/<diskname>.vhd"
  }
}

After

hcl
resource "azurerm_virtual_machine" "example" {
  name                  = "${var.prefix}-vm"
  location              = azurerm_resource_group.example.location
  resource_group_name   = azurerm_resource_group.example.name
  network_interface_ids = [azurerm_network_interface.main.id]
  vm_size               = "Standard_DS1_v2"

  storage_os_disk {
    name              = "myosdisk1"
    caching           = "ReadWrite"
    create_option     = "FromImage"
    managed_disk_type = "Standard_LRS"
  }
}

Explanation:

  • Before: A VHD URI selects the former unmanaged-disk approach, which is no longer supported.
  • After: A managed-disk type is specified. Existing data requires a separate migration procedure.

References