Disaster Recovery of Azure API Management (APIM)

Disaster Recovery of Azure API Management (APIM) 

Disaster Recovery of Azure API Management (APIM)

 
In this post, we will try to understand how we can apply a disaster recovery approach for Azure API Management aka. APIM. So, first of all, we will have to understand the importance of it. It's very important for an application using APIM to have a strong disaster recovery approach, as in case of any issue because of disaster reported, the system using the APIs underneath should be accessible for the users/ systems, and since the APIM is used as the fore front of the applications (mostly) it's important to restore the APIM service ASAP in case of any disaster reported, so that the application consuming the APIs underneath it is not having issue connecting to the APIs. 

  

There are 2 broader options which one can think of: 

  • Have a stand-by service in one or more regions 
  • Service back-up and restore features  

Let's talk about both the approaches (one at a time), because both the approaches have cost and approach differences and obviously the underline benefits. 

 

 

Having a stand-by service in one or more regions 

Even though this comes with an additional cost, as we are taking about having an always on environment in another region which obviously will cost more, but its best in cases where we have a strict recovery time objective (RTO) to have a separate service running in stand-by so that if a disaster is reported at one of the regions the application gateway can route the requests to the alternate service. 

 

 

Service back-up and restore features  

The service back-up and restore features provides the necessary building blocks for implementing disaster recovery strategy in case where we don't have a very stringent RTO requirement. 

 

Back-up and restore operations can also be used for replicating API Management service configuration between operational environments, e.g., development and staging. 

 

Service back-up and restore feature can be leveraged by the REST APIs of Azure Resource Manager. 

 

API To Backup: 

To back up an API Management service issue the following HTTP request: 

  

HTTP Type:  POST  


API End Point:  


Request Body: 

{ 

    "storageAccount": "{storage account name for the backup}", 

    "accessKey": "{access key for the account}", 

    "containerName": "{backup container name}", 

    "backupName": "{backup blob name}" 

} 

  

Where in the API Endpoint : 

subscriptionId - ID of the subscription that holds the API Management service you're trying to back up 

resourceGroupName - name of the resource group of your Azure API Management service 

serviceName - the name of the API Management service you're making a backup of specified at the time of its creation 

api-version - replace with 2019-12-01 

 

 

API To Restore: 

To restore an API Management service from a previously created backup, make the following HTTP request: 


HTTP Type:  POST  

 

Request Body: 

{ 

    "storageAccount": "{storage account name for the backup}", 

    "accessKey": "{access key for the account}", 

    "containerName": "{backup container name}", 

    "backupName": "{backup blob name}" 

} 

  

Where in the API Endpoint : 

subscriptionId - ID of the subscription that holds the API Management service you're restoring a backup into 

resourceGroupName - name of the resource group that holds the Azure API Management service you're restoring a backup into 

serviceName - the name of the API Management service being restored into specified at its creation time 

api-version - replace with api-version=2019-12-01 

 

 

Note: All the Azure Resource Manager REST APIs need to be provided with a Bearer token in the authentication header of the requests. The REST API for backup and restore for Azure Resource Manager and has a different authentication mechanism than the REST APIs for managing your API Management entities.  

  

To understand more about how to authenticate REST APIs for Azure Resource Manager check this. Link 

  

  

Conclusion: 

So, in this post we understood what are the options for having a disaster recovery approach for APIM. Hope you liked the post, do provide inputs in the comment, also if you think the article will be helpful for any of your friends and relatives then please do share the article with them. 

 

And don't forget to subscribe for the new post available so that you get notified on your mailbox. 

 

Happy Learning. 📚 

 

Reference Link: Microsoft Docs 

 

Comments

Popular posts from this blog

What is Cloud Computing?

API Aggregation Using Azure API Management