I'm using Python with Rest API requests to manage backup&restore on Azure VM. I'm able to backup VM, but I can't restore them.
My code in Python to POST
headers = {"Authorization": 'Bearer ' + restapi_azure_authentication()}
myResponse = requests.post(url, headers=headers)
and to POST with JSON push
headers = {"Authorization": 'Bearer ' + restapi_azure_authentication()}
myResponse = requests.post(url, headers=headers, json=json)
I get two messages. If I use this request:
POST /Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore?api-version=2016-06-01
I get this message :
{"error":{"code":"CloudInternalError","message":"Microsoft Azure Backup encountered an internal error.\r\nWait for a few minutes and then try the operatio n again. If the issue persists, please contact Microsoft support.","target":null,"details":null,"innerError":null}}
If I use this request with JSON push :
json = {
"properties": {}
}
I get this message:
{"error":{"code":"UserErrorInvalidRestoreRequest","message":"Restore operation failed due to invalid parameters or format of the parameters is not correct .\r\nPlease ensure parameters provided to restore operation are valid. If the issue persists, please contact Microsoft support.","target":null,"details":n ull,"innerError":null}}
I don't know what to put into "properties" to successfully restore my VM. I'm trying to follow this doc, unfortunately, without success : https://learn.microsoft.com/en-us/rest/api/recoveryservices/restores