title: Using Terraform, how do I create a VM on Azure that uses an existing managed disk?
body: <p>I have imported a managed disk from a blob with terraform.  Now I just need to create a VM with it (it's an OS disk).  How?</p>
  <p>I have:</p>
  <pre><code>resource &quot;azurerm_managed_disk&quot; &quot;MyDisk&quot; {
    name                 = &quot;MyDisk&quot;
    location             = var.location
    resource_group_name  = azurerm_resource_group.rg.name
    storage_account_type = &quot;Standard_LRS&quot;
    create_option        = &quot;Import&quot;
    storage_account_id   = azurerm_storage_account.temp_storage.id
    source_uri           = &quot;${azurerm_storage_container.images.id}/MyDisk.vhd&quot;
    disk_size_gb         = &quot;32&quot;
  
    tags = {
      environment = &quot;staging&quot;
    }
  }
  </code></pre>
  <p>azurerm_linux_virtual_machine doesn't seem to have any way to take this managed disk and make a VM with it.  Anyone know how?</p>
  <p>thank you much</p>