title: Terraform Create VM from managed disk issue
body: <p>I am trying to create a managed disk from the existing snapshot and after that create a VM from that disk.</p>
  <p>I am receiving errors while creating the managed disk.</p>
  <p>Here is my code.</p>
  <p>Main.tf</p>
  <pre><code>resource &quot;azurerm_managed_disk&quot; &quot;copy&quot; {
  
    name = &quot;myOsDisk1&quot;
    location = &quot;East US&quot;
    resource_group_name = data.azurerm_resource_group.test.name
    storage_account_type = &quot;Standard_LRS&quot;
    create_option = &quot;Copy&quot;
    source_resource_id = var.snapshot_id
    disk_size_gb = &quot;50&quot;
  }
  
  resource &quot;azurerm_virtual_machine&quot; &quot;myterraformvm&quot; {
  
      name                  = &quot;Test-01&quot;
      location              = &quot;East Us&quot;
      resource_group_name = data.azurerm_resource_group.test.name
      network_interface_ids = [&quot;${azurerm_network_interface.main.id}&quot;]
      vm_size               = &quot;Standard_DS1_v2&quot;
  
      storage_os_disk {
      name              = &quot;${azurerm_managed_disk.copy.name}&quot;
      os_type           = &quot;windows&quot;
      managed_disk_id   = &quot;${azurerm_managed_disk.copy.id}&quot;
      create_option     = &quot;Attach&quot;
      }
  }
  </code></pre>
  <p>Below is the error</p>
  <blockquote>
  <p>Error: Error creating/updating Managed Disk &quot;myOsDisk1&quot; (Resource Group &quot;vm-from-snap&quot;): compute.DisksClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=&quot;InvalidParameter&quot; Message=&quot;Entity not of expected type&quot; Target=&quot;sourceResourceId&quot;</p>
  <p>on main.tf line 44, in resource &quot;azurerm_managed_disk&quot; &quot;copy&quot;:
  44: resource &quot;azurerm_managed_disk&quot; &quot;copy&quot; {</p>
  </blockquote>