Skip to content

Commit fe4d1c3

Browse files
authored
Merge pull request #80721 from vladvino/dr
Updated with answers to common questions
2 parents 77e27ba + 353aabe commit fe4d1c3

File tree

1 file changed

+48
-42
lines changed

1 file changed

+48
-42
lines changed

articles/api-management/api-management-howto-disaster-recovery-backup-restore.md

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,26 @@ ms.workload: mobile
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
1414
ms.topic: article
15-
ms.date: 11/14/2018
15+
ms.date: 06/26/2019
1616
ms.author: apimpm
1717
---
18+
1819
# How to implement disaster recovery using service backup and restore in Azure API Management
1920

2021
By publishing and managing your APIs via Azure API Management, you're taking advantage of fault tolerance and infrastructure capabilities that you'd otherwise design, implement, and manage manually. The Azure platform mitigates a large fraction of potential failures at a fraction of the cost.
2122

22-
To recover from availability problems that affect the region that hosts your API Management service, be ready to reconstitute your service in another region at any time. Depending on your availability and recovery time goals, you might want to reserve a backup service in one or more regions. You might also try to maintain their configuration and content in sync with the active service. The service "backup and restore" feature provides the necessary building block for implementing your disaster recovery strategy.
23+
To recover from availability problems that affect the region that hosts your API Management service, be ready to reconstitute your service in another region at any time. Depending on your recovery time objective, you might want to keep a standby service in one or more regions. You might also try to maintain their configuration and content in sync with the active service according to your recovery point objective. The service backup and restore features provides the necessary building blocks for implementing disaster recovery strategy.
2324

24-
This guide shows how to authenticate Azure Resource Manager requests. It also shows how to back up and restore your API Management service instances.
25+
Backup and restore operations can also be used for replicating API Management service configuration between operational environments, e.g. development and staging. Beware that runtime data such as users and subscriptions will be copied as well, which might not always be desirable.
2526

26-
> [!NOTE]
27-
> The process for backing up and restoring an API Management service instance for disaster recovery can also be used for replicating API Management service instances for scenarios such as staging.
27+
This guide shows how to automate backup and restore operations and how to ensure successful authenticating of backup and restore requests by Azure Resource Manager.
28+
29+
> [!IMPORTANT]
30+
> Restore operation doesn't change custom hostname configuration of the target service. We recommend to use the same custom hostname and TLS certificate for both active and standby services, so that, after restore operation completes, the traffic can be re-directed to the standby instance by a simple DNS CNAME change.
2831
>
32+
> Backup operation does not capture pre-aggregated log data used in reports shown on the Analytics blade in the Azure portal.
33+
34+
> [!WARNING]
2935
> Each backup expires after 30 days. If you attempt to restore a backup after the 30-day expiration period has expired, the restore will fail with a `Cannot restore: backup expired` message.
3036
3137
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
@@ -39,9 +45,9 @@ This guide shows how to authenticate Azure Resource Manager requests. It also sh
3945
4046
All of the tasks that you do on resources using the Azure Resource Manager must be authenticated with Azure Active Directory using the following steps:
4147

42-
* Add an application to the Azure Active Directory tenant.
43-
* Set permissions for the application that you added.
44-
* Get the token for authenticating requests to Azure Resource Manager.
48+
- Add an application to the Azure Active Directory tenant.
49+
- Set permissions for the application that you added.
50+
- Get the token for authenticating requests to Azure Resource Manager.
4551

4652
### Create an Azure Active Directory application
4753

@@ -50,9 +56,11 @@ All of the tasks that you do on resources using the Azure Resource Manager must
5056

5157
> [!NOTE]
5258
> If the Azure Active Directory default directory isn't visible to your account, contact the administrator of the Azure subscription to grant the required permissions to your account.
59+
5360
3. Click **New application registration**.
5461

5562
The **Create** window appears on the right. That's where you enter the AAD app relevant information.
63+
5664
4. Enter a name for the application.
5765
5. For the application type, select **Native**.
5866
6. Enter a placeholder URL such as `http://resources` for the **Redirect URI**, as it's a required field, but the value isn't used later. Click the check box to save the application.
@@ -107,6 +115,7 @@ Replace `{tenant id}`, `{application id}`, and `{redirect uri}` using the follow
107115
1. Replace `{tenant id}` with the tenant ID of the Azure Active Directory application you created. You can access the ID by clicking **App registrations** -> **Endpoints**.
108116

109117
![Endpoints][api-management-endpoint]
118+
110119
2. Replace `{application id}` with the value you get by navigating to the **Settings** page.
111120
3. Replace the `{redirect uri}` with the value from the **Redirect URIs** tab of your Azure Active Directory application.
112121

@@ -137,34 +146,34 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
137146

138147
where:
139148

140-
* `subscriptionId` - ID of the subscription that holds the API Management service you're trying to back up
141-
* `resourceGroupName` - name of the resource group of your Azure API Management service
142-
* `serviceName` - the name of the API Management service you're making a backup of specified at the time of its creation
143-
* `api-version` - replace with `2018-06-01-preview`
149+
- `subscriptionId` - ID of the subscription that holds the API Management service you're trying to back up
150+
- `resourceGroupName` - name of the resource group of your Azure API Management service
151+
- `serviceName` - the name of the API Management service you're making a backup of specified at the time of its creation
152+
- `api-version` - replace with `2018-06-01-preview`
144153

145154
In the body of the request, specify the target Azure storage account name, access key, blob container name, and backup name:
146155

147156
```json
148157
{
149-
"storageAccount": "{storage account name for the backup}",
150-
"accessKey": "{access key for the account}",
151-
"containerName": "{backup container name}",
152-
"backupName": "{backup blob name}"
158+
"storageAccount": "{storage account name for the backup}",
159+
"accessKey": "{access key for the account}",
160+
"containerName": "{backup container name}",
161+
"backupName": "{backup blob name}"
153162
}
154163
```
155164

156165
Set the value of the `Content-Type` request header to `application/json`.
157166

158-
Backup is a long running operation that may take more than a minute to complete. If the request succeeded and the backup process began, you receive a `202 Accepted` response status code with a `Location` header. Make 'GET' requests to the URL in the `Location` header to find out the status of the operation. While the backup is in progress, you continue to receive a '202 Accepted' status code. A Response code of `200 OK` indicates successful completion of the backup operation.
167+
Backup is a long running operation that may take more than a minute to complete. If the request succeeded and the backup process began, you receive a `202 Accepted` response status code with a `Location` header. Make 'GET' requests to the URL in the `Location` header to find out the status of the operation. While the backup is in progress, you continue to receive a '202 Accepted' status code. A Response code of `200 OK` indicates successful completion of the backup operation.
159168

160169
Note the following constraints when making a backup request:
161170

162-
* **Container** specified in the request body **must exist**.
163-
* While backup is in progress, **avoid changes in service management** such as SKU upgrade or downgrade, change in domain name, and more.
164-
* Restore of a **backup is guaranteed only for 30 days** since the moment of its creation.
165-
* **Usage data** used for creating analytics reports **isn't included** in the backup. Use [Azure API Management REST API][Azure API Management REST API] to periodically retrieve analytics reports for safekeeping.
166-
* The frequency with which you perform service backups affect your recovery point objective. To minimize it, we recommend implementing regular backups and performing on-demand backups after you make changes to your API Management service.
167-
* **Changes** made to the service configuration, (for example, APIs, policies, and developer portal appearance) while backup operation is in process **might be excluded from the backup and will be lost**.
171+
- **Container** specified in the request body **must exist**.
172+
- While backup is in progress, **avoid changes in service management** such as SKU upgrade or downgrade, change in domain name, and more.
173+
- Restore of a **backup is guaranteed only for 30 days** since the moment of its creation.
174+
- **Usage data** used for creating analytics reports **isn't included** in the backup. Use [Azure API Management REST API][azure api management rest api] to periodically retrieve analytics reports for safekeeping.
175+
- The frequency with which you perform service backups affect your recovery point objective. To minimize it, we recommend implementing regular backups and performing on-demand backups after you make changes to your API Management service.
176+
- **Changes** made to the service configuration, (for example, APIs, policies, and developer portal appearance) while backup operation is in process **might be excluded from the backup and will be lost**.
168177

169178
### <a name="step2"> </a>Restore an API Management service
170179

@@ -176,19 +185,19 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
176185

177186
where:
178187

179-
* `subscriptionId` - ID of the subscription that holds the API Management service you're restoring a backup into
180-
* `resourceGroupName` - name of the resource group that holds the Azure API Management service you're restoring a backup into
181-
* `serviceName` - the name of the API Management service being restored into specified at its creation time
182-
* `api-version` - replace with `2018-06-01-preview`
188+
- `subscriptionId` - ID of the subscription that holds the API Management service you're restoring a backup into
189+
- `resourceGroupName` - name of the resource group that holds the Azure API Management service you're restoring a backup into
190+
- `serviceName` - the name of the API Management service being restored into specified at its creation time
191+
- `api-version` - replace with `2018-06-01-preview`
183192

184193
In the body of the request, specify the backup file location. That is, add the Azure storage account name, access key, blob container name, and backup name:
185194

186195
```json
187196
{
188-
"storageAccount": "{storage account name for the backup}",
189-
"accessKey": "{access key for the account}",
190-
"containerName": "{backup container name}",
191-
"backupName": "{backup blob name}"
197+
"storageAccount": "{storage account name for the backup}",
198+
"accessKey": "{access key for the account}",
199+
"containerName": "{backup container name}",
200+
"backupName": "{backup blob name}"
192201
}
193202
```
194203

@@ -204,24 +213,21 @@ Restore is a long running operation that may take up to 30 or more minutes to co
204213
<!-- Dummy comment added to suppress markdown lint warning -->
205214

206215
> [!NOTE]
207-
> Backup and restore operations can also be performed with PowerShell *Backup-AzApiManagement* and *Restore-AzApiManagement* commands respectively.
216+
> Backup and restore operations can also be performed with PowerShell _Backup-AzApiManagement_ and _Restore-AzApiManagement_ commands respectively.
208217
209218
## Next steps
210219

211220
Check out the following resources for different walkthroughs of the backup/restore process.
212221

213-
* [Replicate Azure API Management Accounts](https://www.returngis.net/en/2015/06/replicate-azure-api-management-accounts/)
214-
* [Automating API Management Backup and Restore with Logic Apps](https://github.com/Azure/api-management-samples/tree/master/tutorials/automating-apim-backup-restore-with-logic-apps)
215-
* [Azure API Management: Backing Up and Restoring Configuration](https://blogs.msdn.com/b/stuartleeks/archive/2015/04/29/azure-api-management-backing-up-and-restoring-configuration.aspx)
216-
*The approach detailed by Stuart does not match the official guidance but it is interesting.*
217-
218-
[Backup an API Management service]: #step1
219-
[Restore an API Management service]: #step2
220-
221-
[Azure API Management REST API]: https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/api-management-rest
222+
- [Replicate Azure API Management Accounts](https://www.returngis.net/en/2015/06/replicate-azure-api-management-accounts/)
223+
- [Automating API Management Backup and Restore with Logic Apps](https://github.com/Azure/api-management-samples/tree/master/tutorials/automating-apim-backup-restore-with-logic-apps)
224+
- [Azure API Management: Backing Up and Restoring Configuration](https://blogs.msdn.com/b/stuartleeks/archive/2015/04/29/azure-api-management-backing-up-and-restoring-configuration.aspx)
225+
_The approach detailed by Stuart does not match the official guidance but it is interesting._
222226

227+
[backup an api management service]: #step1
228+
[restore an api management service]: #step2
229+
[azure api management rest api]: https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/api-management-rest
223230
[api-management-add-aad-application]: ./media/api-management-howto-disaster-recovery-backup-restore/api-management-add-aad-application.png
224-
225231
[api-management-aad-permissions]: ./media/api-management-howto-disaster-recovery-backup-restore/api-management-aad-permissions.png
226232
[api-management-aad-permissions-add]: ./media/api-management-howto-disaster-recovery-backup-restore/api-management-aad-permissions-add.png
227233
[api-management-aad-delegated-permissions]: ./media/api-management-howto-disaster-recovery-backup-restore/api-management-aad-delegated-permissions.png

0 commit comments

Comments
 (0)