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-deploy-multi-region.md
+71-28Lines changed: 71 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,82 +1,91 @@
1
1
---
2
-
title: Deploy Azure API Management services to multiple Azure regions
2
+
title: Deploy Azure API Management instance to multiple Azure regions
3
3
titleSuffix: Azure API Management
4
-
description: Learn how to deploy an Azure API Management service instance to multiple Azure regions.
4
+
description: Learn how to deploy a Premium tier Azure API Management instance to multiple Azure regions to improve API gateway availability.
5
5
author: dlepow
6
6
7
7
ms.service: api-management
8
8
ms.topic: how-to
9
-
ms.date: 04/13/2021
9
+
ms.date: 09/27/2022
10
10
ms.author: danlep
11
11
---
12
12
13
-
# How to deploy an Azure API Management service instance to multiple Azure regions
13
+
# Deploy an Azure API Management instance to multiple Azure regions
14
14
15
-
Azure API Management supports multi-region deployment, which enables API publishers to distribute a single Azure API management service across any number of supported Azure regions. Multi-region feature helps reduce request latency perceived by geographically distributed API consumers and improves service availability if one region goes offline.
15
+
Azure API Management supports multi-region deployment, which enables API publishers to add regional API gateways to an existing API Management instance in one or more supported Azure regions. Multi-region deployment helps reduce request latency perceived by geographically distributed API consumers and improves service availability if one region goes offline.
16
16
17
-
A new Azure API Management service initially contains only one [unit][unit] in a single Azure region, the Primary region. Additional units can be added to the Primary or Secondary regions. An API Management gateway component is deployed to every selected Primary and Secondary region. Incoming API requests are automatically directed to the closest region. If a region goes offline, the API requests will be automatically routed around the failed region to the next closest gateway.
17
+
When adding a region, you configure:
18
18
19
-
> [!NOTE]
20
-
> Only the gateway component of API Management is deployed to all regions. The service management component and developer portal are hosted in the Primary region only. Therefore, in case of the Primary region outage, access to the developer portal and ability to change configuration (e.g. adding APIs, applying policies) will be impaired until the Primary region comes back online. While the Primary region is offline, available Secondary regions will continue to serve the API traffic using the latest configuration available to them. Optionally enable [zone redundancy](../availability-zones/migrate-api-mgt.md) to improve the availability and resiliency of the Primary or Secondary regions.
19
+
* The number of scale [units](upgrade-and-scale.md) that region will host.
20
+
21
+
* Optional [zone redundancy](../availability-zones/migrate-api-mgt.md), if that region supports it.
22
+
23
+
*[Virtual network](virtual-network-concepts.md) settings in the added region, if networking is configured in the existing region or regions.
21
24
22
25
>[!IMPORTANT]
23
26
> The feature to enable storing customer data in a single region is currently only available in the Southeast Asia Region (Singapore) of the Asia Pacific Geo. For all other regions, customer data is stored in Geo.
* If you have not yet created an API Management service instance, see [Create an API Management service instance](get-started-create-service-instance.md). Select the Premium service tier.
31
-
* If your API Management instance is deployed in a [virtual network](api-management-using-with-vnet.md), ensure that you set up a virtual network, subnet, and public IP address in the location that you plan to add.
36
+
* If you haven't created an API Management service instance, see [Create an API Management service instance](get-started-create-service-instance.md). Select the Premium service tier.
37
+
* If your API Management instance is deployed in a virtual network, ensure that you set up a virtual network, subnet, and public IP address in the location that you plan to add. See [virtual network prerequisites](api-management-using-with-vnet.md#prerequisites).
32
38
33
-
## <aname="add-region"> </a>Deploy API Management service to an additional location
39
+
## <aname="add-region"> </a>Deploy API Management service to an additional region
34
40
35
-
1. In the Azure portal, navigate to your API Management service and select **Locations**in the menu.
41
+
1. In the Azure portal, navigate to your API Management service and select **Locations**from the left menu.
36
42
1. Select **+ Add** in the top bar.
37
-
1. Select the location from the drop-down list.
43
+
1. Select the added location from the dropdown list.
38
44
1. Select the number of scale **[Units](upgrade-and-scale.md)** in the location.
1. Optionally select one or more [**Availability zones**](../availability-zones/migrate-api-mgt.md).
40
46
1. If the API Management instance is deployed in a [virtual network](api-management-using-with-vnet.md), configure virtual network settings in the location. Select an existing virtual network, subnet, and public IP address that are available in the location.
41
47
1. Select **Add** to confirm.
42
48
1. Repeat this process until you configure all locations.
43
49
1. Select **Save** in the top bar to start the deployment process.
44
50
45
-
## <aname="remove-region"> </a>Delete an API Management service location
51
+
## <aname="remove-region"> </a>Remove an API Management service region
46
52
47
-
1. In the Azure portal, navigate to your API Management service and click on the **Locations**entry in the menu.
48
-
2. For the location you would like to remove, open the context menu using the **...** button at the right end of the table. Select the **Delete** option.
49
-
3. Confirm the deletion and click**Save** to apply the changes.
53
+
1. In the Azure portal, navigate to your API Management service and select **Locations**from the left menu.
54
+
2. For the location you would like to remove, select the context menu using the **...** button at the right end of the table. Select **Delete**.
55
+
3. Confirm the deletion and select**Save** to apply the changes.
50
56
51
57
## <aname="route-backend"> </a>Route API calls to regional backend services
52
58
53
-
By default, each API routes requests to a single backend service URL. Even though there are Azure API Management instances in various regions, the API gateway will still forward requests to the same backend service, which is deployed in only one region. In this case, the performance gain will come only from responses cached within Azure API Management in a region specific to the request, but contacting the backend across the globe may still cause high latency.
59
+
By default, each API routes requests to a single backend service URL. Even if you've configured Azure API Management gateways in various regions, the API gateway will still forward requests to the same backend service, which is deployed in only one region. In this case, the performance gain will come only from responses cached within Azure API Management in a region specific to the request; contacting the backend across the globe may still cause high latency.
54
60
55
-
To fully leverage geographical distribution of your system, you should have backend services deployed in the same regions as Azure API Management instances. Then, using policies and `@(context.Deployment.Region)` property, you can route the traffic to local instances of your backend.
61
+
To take advantage of geographical distribution of your system, you should have backend services deployed in the same regions as Azure API Management instances. Then, using policies and `@(context.Deployment.Region)` property, you can route the traffic to local instances of your backend.
56
62
57
-
1. Navigate to your Azure API Management instance and click on **APIs** from the left menu.
63
+
> [!TIP]
64
+
> Optionally set the `disableGateway` property in a regional gateway to disable routing of API traffic there. For example, temporarily disable a regional gateway when testing or updating a regional backend service.
65
+
66
+
1. Navigate to your Azure API Management instance and select **APIs** from the left menu.
58
67
2. Select your desired API.
59
-
3.Click**Code editor** from the arrow dropdown in the **Inbound processing**.
68
+
3.Select**Code editor** from the arrow dropdown in the **Inbound processing**.
4. Use the `set-backend` combined with conditional `choose` policies to construct a proper routing policy in the `<inbound> </inbound>` section of the file.
64
73
65
-
For example, the below XML file would work for West US and East Asia regions:
74
+
For example, the following XML file would work for West US and East Asia regions:
@@ -97,14 +106,48 @@ To fully leverage geographical distribution of your system, you should have back
97
106
98
107
## <aname="custom-routing"> </a>Use custom routing to API Management regional gateways
99
108
100
-
API Management routes the requests to a regional _gateway_ based on [the lowest latency](../traffic-manager/traffic-manager-routing-methods.md#performance). Although it is not possible to override this setting in API Management, you can use your own Traffic Manager with custom routing rules.
109
+
API Management routes the requests to a regional gateway based on [the lowest latency](../traffic-manager/traffic-manager-routing-methods.md#performance). Although it isn't possible to override this setting in API Management, you can use your own Traffic Manager with custom routing rules.
101
110
102
111
1. Create your own [Azure Traffic Manager](https://azure.microsoft.com/services/traffic-manager/).
103
-
1. If you are using a custom domain, [use it with the Traffic Manager](../traffic-manager/traffic-manager-point-internet-domain.md) instead of the API Management service.
112
+
1. If you're using a custom domain, [use it with the Traffic Manager](../traffic-manager/traffic-manager-point-internet-domain.md) instead of the API Management service.
104
113
1. [Configure the API Management regional endpoints in Traffic Manager](../traffic-manager/traffic-manager-manage-endpoints.md). The regional endpoints follow the URL pattern of `https://<service-name>-<region>-01.regional.azure-api.net`, for example `https://contoso-westus2-01.regional.azure-api.net`.
105
114
1. [Configure the API Management regional status endpoints in Traffic Manager](../traffic-manager/traffic-manager-monitoring.md). The regional status endpoints follow the URL pattern of `https://<service-name>-<region>-01.regional.azure-api.net/status-0123456789abcdef`, for example `https://contoso-westus2-01.regional.azure-api.net/status-0123456789abcdef`.
106
115
1. Specify [the routing method](../traffic-manager/traffic-manager-routing-methods.md) of the Traffic Manager.
107
116
117
+
## Virtual networking
118
+
119
+
This section provides considerations for multi-region deployments when the API Management instance is injected in a virtual network.
120
+
121
+
* Configure each regional network independently. The [connectivity requirements](virtual-network-reference.md) such as required network security group rules for a virtual network in an added region are the same as those for a network in the primary region.
122
+
* Virtual networks in the different regions don't need to be peered.
123
+
124
+
### IP addresses
125
+
126
+
* A public virtual IP address is created in every region added with a virtual network. For virtual networks in either [external mode](api-management-using-with-vnet.md) or [internal mode](api-management-using-with-internal-vnet.md), this public IP address is required for management traffic on port `3443`.
127
+
128
+
* **External VNet mode** - The public IP addresses are also required to route public HTTP traffic to the API gateways.
129
+
130
+
* **Internal VNet mode** - A private IP address is also created in every region added with a virtual network. Use these addresses to connect within the network to the API Management endpoints in the primary and secondary regions.
131
+
132
+
### Routing
133
+
134
+
* **External VNet mode** - Routing of public HTTP traffic to the regional gateways is handled automatically, in the same way it is for a non-networked API Management instance.
135
+
136
+
* **Internal VNet mode** - Private HTTP traffic isn't routed or load-balanced to the regional gateways by default. Users own the routing and are responsible for bringing their own solution to manage routing and private load balancing across multiple regions. Example solutions include Azure Application Gateway and Azure Traffic Manager.
137
+
138
+
## Next steps
139
+
140
+
* Learn more about [zone redundancy](../availability-zones/migrate-api-mgt.md) to improve the availability of an API Management instance in a region.
141
+
142
+
* For more information about virtual networks and API Management, see:
143
+
144
+
* [Connect to a virtual network using Azure API Management](api-management-using-with-vnet.md)
145
+
146
+
* [Connect to a virtual network in internal mode using Azure API Management](api-management-using-with-internal-vnet.md)
147
+
148
+
* [IP addresses of API Management](api-management-howto-ip-addresses.md)
149
+
150
+
108
151
[create an api management service instance]: get-started-create-service-instance.md
109
152
[get started with azure api management]: get-started-create-service-instance.md
110
153
[deploy an api management service instance to a new region]: #add-region
* With multi-region deployment, only the [gateway component](../articles/api-management/api-management-key-concepts.md#api-management-components) of your API Management instance is replicated to multiple regions. The instance's management plane and developer portal remain hosted only in the *primary* region, the region where you originally deployed the service.
11
+
12
+
* Gateway configurations such as APIs and policy definitions are regularly synchronized between the primary and secondary regions you add. Multi-region deployment provides availability of the API gateway in more than one region and provides service availability if one region goes offline.
13
+
14
+
* When API Management receives public HTTP requests to the primary gateway endpoint, traffic is routed to a regional gateway based on lowest latency, which can reduce latency experienced by geographically distributed API consumers.
15
+
16
+
* If a region goes offline, API requests are automatically routed around the failed region to the next closest gateway.
17
+
18
+
* If the primary region goes offline, the API Management management plane and developer portal become unavailable, but secondary regions continue to serve API requests using the most recent gateway configuration.
0 commit comments