Microsoft recently released the Dynamics 365 Customer Engagement Online Management API which enables you to programmatically manipulate your Dynamics 365 instance (almost everything you can do from the Dynamics 365 Admin Center) including backing-up your instance to Azure storage.
The InstanceBackups POST operation contains an IsAzureBackup boolean parameter which, in conjunction with the AzureStorageInformation parameter, copies your Dynamics 365 backup to a designated Azure Storage.
Your post request will look like the following:
POST https://admin.services.crm.dynamics.com/api/v1/InstanceBackups
Header
Content-Type: application/json
Authorization: Bearer <OAuth Token>
Body
{
“InstanceId”: “<your instance GUID>”,
“Label”: “My first Azure backup”,
“Notes”: “An instance backup to Azure Storage”,
“IsAzureBackup”: “true”,
“AzureStorageInformation”: {
“ContainerName”: “<AzureStorageContainer>”,
“StorageAccountKey”: “<AzureStorageAccountKey>”,
“StorageAccountName”: “<AzureStorageAccountName>”
}
}
You can then monitor your request progress by calling the GET https://admin.services.crm.dynamics.com/api/v1/Operation/<OperationGuid> operation
Make sure you select the correct service URL as described in the documentation.
Once your backup is successful it is available for an entire year.
In my next post I’ll delve into how to construct your request and if time permits create a sample console application to schedule daily backups.
Marius Agur
Did you get this to work using the admin api?
Been trying this since august 10th with the admin api in EMEA, only gives error 500.
Rami Mounla
Thanks for reaching out Marius. As per my tweet reply https://twitter.com/ramimounla/status/904117603928383488 yes I did. Let me know if Microsoft resolves your ticket.
Joan Martin
I am pretty much pleased with your good work. You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.
Paul Owen
Hi Rami, did you do the follow up posts to this?
“In my next post I’ll delve into how to construct your request and if time permits create a sample console application to schedule daily backups.”