title: Azure Site Recovery - REST API, Powershell and Automation
body: <p>Has anyone come up with a complete solution to protect and replicate VMs from on-prem (either VMware or HyperV) to Azure using either the REST API or the Powershell module?</p>
  
  <p>I recently completed a POC with ASR and was able to replicate a couple dozen VMs associated with three different applications.  I replicated out of VMware and into Azure.  I was able to failover and failback successfully.</p>
  
  <p>I did all of the POC work using the GUI (portal.azure.com).  Now I have to figure out how to protect ~2000 VMs and there is no way that I am going to do that with the GUI.  But the MS documentation has me running in circles.</p>
  
  <p>(<a href="https://docs.microsoft.com/en-us/azure/site-recovery/" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/site-recovery/</a>)</p>
  
  <p>It would be very helpful if any of you can share the sequence of steps to protect and replicate a VM.  The MS documentation does not lay out how the various components (fabrics, protection policies, protection containers, protection items, etc.) are related to each other.</p>
  
  <p>I do not need specific syntax.  The documentation does a passable job of detailing the syntax.  I could use some guidance on the task sequence.</p>
  
  <p>If it helps to understand the bigger picture, my intention is to use a System Center Orchestrator runbook to ingest a CSV list of VMs, parse that out into input for the Azure REST API / Powershell, and then enable protection.</p>
  
  <p>Thanks in advance for any assistance or guidance that you are able to provide. </p>