title: Azure Powershell: Restoring a blob snapshot to a different VM
body: <p>Having followed this article (<a href="http://blog.greatrexpectations.com/2013/04/24/using-blob-snapshots-to-backup-azure-virtual-machines/" rel="nofollow">http://blog.greatrexpectations.com/2013/04/24/using-blob-snapshots-to-backup-azure-virtual-machines/</a>) I can create snapshots of a VM, but I now want to  restore that snapshot to a different VM - we sometimes need to restore backups to recover individual files and I want to ensure I can do this in Azure before moving to them.</p>
  
  <p>I've tried:</p>
  
  <pre><code>$restorePath = "vhds/my-new-vm.vhd"
  $restoreBlob = $blobClient.GetBlobReference($restorePath)
  $restoreBlob.CopyFromBlob($snapshots[$snapshots.Length -1])
  </code></pre>
  
  <p>But it gives me:</p>
  
  <pre><code>Exception calling "CopyFromBlob" with "1" argument(s): "There is currently 
  a lease on the blob and no lease ID was specified in the request."
  </code></pre>
  
  <p>I can't figure out how to get a lease ID, or what to do with it.</p>