JSON Template for Creating a Recovery Plan Using PowerShell RRS feed

All replies

  • Hello,

    I'm attempting to create a new recovery plan in ASR using the PowerShell and the commandlet with a JSON file for import. I was able to use the Get command to export a JSON from an existing Recovery Plan but when I modify the contents of the JSON to reflect a new Recovery Plan I cant seem to get it to work.  Does anyone have a template I can use for this or some additional documentation on the process?




    I also posted this same question here as I didnt see this forum at first and it seemed like a better fit.  


    Thursday, September 12, 2019 4:35 PM
  • Do you get any error message after modifying the JSON template?

    Please share the template that isn't working. We will evaluate the template and point you in the right direction if we find any issues with it.

    Friday, September 13, 2019 6:37 AM
  • Hi Sadiqh!

    Below is the error and the items I modified in the JSON that was saved via

    Get-AzureRmRecoveryServicesAsrRecoveryPlan -path

    PS C:\temp> New-AzureRmRecoveryServicesAsrRecoveryPlan -Path C:\temp\OnClickSharePointTestFailover.json
    New-AzureRmRecoveryServicesAsrRecoveryPlan : Operation failed.
    Value cannot be null.
    Parameter name: value
    At line:1 char:1
    + New-AzureRmRecoveryServicesAsrRecoveryPlan -Path C:\temp\OnClickShare ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [New-AzureRmReco...AsrRecoveryPlan], Exception
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.NewAzureRmRecoveryServicesAsrRecoveryPlan

    These are the fields I modified in the JSON file that pointed back to the recovery plan I exported.  

    "friendlyName": "TestImportOnClickSharePointTestFailover",
    "name": "TestImportOnClickSharePointTestFailover",

    Friday, September 13, 2019 1:55 PM
  • It worked for me. Not sure what is causing issue on your end. You may send an email to AzCommunity [at] Microsoft dot com attaching the full JSON file so that I can try once again. However, if you need quick resolution I recommend reaching out to Azure technical support team by creating a support request.

    Tuesday, September 17, 2019 1:30 PM
  • Sadiqh would you mind providing a step by step on the process you followed with the commandlets and JSON file?  Maybe I'm just missing a parameter or something silly.

    I'll also send my full JSON to the address above.  Should I put anything in the subject or body to make it easy for you to find?


    Wednesday, September 18, 2019 8:41 PM
  • Subject: ATTN: Sadiqh and this forum link for context.

    Friday, September 20, 2019 10:21 AM
  • Sadiqh just an FYI that I sent over the JSON this morning.  Please let me know if you need anything additional from this end and thanks!
    Tuesday, September 24, 2019 2:41 AM
  • Sorry for the delay! I was OOF for a short period and have been trying to work with your custom JSON template but failed to get success. Though everything seems to be good with the template but not sure why it isn't working. I suggest you post your question on GitHub Developer community to target our developer community who can share their own experiences. In the mean while I will check with site recovery dev team if they can help in this matter.

    Friday, October 18, 2019 10:47 AM
  • Just hooking in to this thread since I'm curious to how this was supposed to work and get more insights. How are using the Get-AzRecoveryServicesAsrRecoveryPlan cmdlet? There seems to be zero documentation on what a recovery plan definition json should look like to get it to work.

    I assume you're something like this, which would return way to few information to get New-AzureRmRecoveryServicesAsrRecoveryPlan working imho. So don't mind me being here.

    Get-AzRecoveryServicesAsrRecoveryPlan | Convert-ToJson | Out-File asrRecoveryPlan.json

    Friday, October 18, 2019 12:09 PM