You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/api-management-howto-disaster-recovery-backup-restore.md
+48-42Lines changed: 48 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,20 +12,26 @@ ms.workload: mobile
12
12
ms.tgt_pltfrm: na
13
13
ms.devlang: na
14
14
ms.topic: article
15
-
ms.date: 11/14/2018
15
+
ms.date: 06/26/2019
16
16
ms.author: apimpm
17
17
---
18
+
18
19
# How to implement disaster recovery using service backup and restore in Azure API Management
19
20
20
21
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.
21
22
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.
23
24
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.
25
26
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.
28
31
>
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]
29
35
> 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.
@@ -39,9 +45,9 @@ This guide shows how to authenticate Azure Resource Manager requests. It also sh
39
45
40
46
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:
41
47
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.
45
51
46
52
### Create an Azure Active Directory application
47
53
@@ -50,9 +56,11 @@ All of the tasks that you do on resources using the Azure Resource Manager must
50
56
51
57
> [!NOTE]
52
58
> 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
+
53
60
3. Click **New application registration**.
54
61
55
62
The **Create** window appears on the right. That's where you enter the AAD app relevant information.
63
+
56
64
4. Enter a name for the application.
57
65
5. For the application type, select **Native**.
58
66
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
107
115
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**.
108
116
109
117
![Endpoints][api-management-endpoint]
118
+
110
119
2. Replace `{application id}` with the value you get by navigating to the **Settings** page.
111
120
3. Replace the `{redirect uri}` with the value from the **Redirect URIs** tab of your Azure Active Directory application.
112
121
@@ -137,34 +146,34 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
137
146
138
147
where:
139
148
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`
144
153
145
154
In the body of the request, specify the target Azure storage account name, access key, blob container name, and backup name:
146
155
147
156
```json
148
157
{
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}"
153
162
}
154
163
```
155
164
156
165
Set the value of the `Content-Type` request header to `application/json`.
157
166
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.
159
168
160
169
Note the following constraints when making a backup request:
161
170
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**.
168
177
169
178
### <aname="step2"> </a>Restore an API Management service
170
179
@@ -176,19 +185,19 @@ POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/
176
185
177
186
where:
178
187
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`
183
192
184
193
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:
185
194
186
195
```json
187
196
{
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}"
192
201
}
193
202
```
194
203
@@ -204,24 +213,21 @@ Restore is a long running operation that may take up to 30 or more minutes to co
204
213
<!-- Dummy comment added to suppress markdown lint warning -->
205
214
206
215
> [!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.
208
217
209
218
## Next steps
210
219
211
220
Check out the following resources for different walkthroughs of the backup/restore process.
212
221
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._
222
226
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
0 commit comments