|
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: 07/25/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 any number of 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 | + |
| 19 | +* The number of scale [units](upgrade-and-scale.md) that region will host. |
| 20 | + |
| 21 | +* [Virtual network](../articles/api-management/virtual-network-concepts.md) settings in the added region, if networking is configured in the existing region or regions. |
| 22 | + |
| 23 | +* Optional [zone redundancy](../articles/availability-zones/migrate-api-mgt.md), if that region supports it. |
18 | 24 |
|
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. |
21 | 25 |
|
22 | 26 | >[!IMPORTANT]
|
23 | 27 | > 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.
|
24 | 28 |
|
25 | 29 | [!INCLUDE [premium.md](../../includes/api-management-availability-premium.md)]
|
26 | 30 |
|
| 31 | +## About multi-region deployment |
| 32 | + |
| 33 | +[!INCLUDE [api-management-multi-region-concepts](../../includes/api-management-multi-region-concepts.md)] |
27 | 34 |
|
28 | 35 | ## Prerequisites
|
29 | 36 |
|
30 |
| -* 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. |
| 37 | +* If you haven't 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 | 38 | * 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.
|
32 | 39 |
|
33 | 40 | ## <a name="add-region"> </a>Deploy API Management service to an additional location
|
34 | 41 |
|
35 |
| -1. In the Azure portal, navigate to your API Management service and select **Locations** in the menu. |
| 42 | +1. In the Azure portal, navigate to your API Management service and select **Locations** from the left menu. |
36 | 43 | 1. Select **+ Add** in the top bar.
|
37 |
| -1. Select the location from the drop-down list. |
| 44 | +1. Select the added location from the dropdown list. |
38 | 45 | 1. Select the number of scale **[Units](upgrade-and-scale.md)** in the location.
|
39 |
| -1. Optionally enable [**Availability zones**](../availability-zones/migrate-api-mgt.md). |
| 46 | +1. Optionally select one or more [**Availability zones**](../availability-zones/migrate-api-mgt.md). |
40 | 47 | 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 | 48 | 1. Select **Add** to confirm.
|
42 | 49 | 1. Repeat this process until you configure all locations.
|
43 | 50 | 1. Select **Save** in the top bar to start the deployment process.
|
44 | 51 |
|
45 | 52 | ## <a name="remove-region"> </a>Delete an API Management service location
|
46 | 53 |
|
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. |
| 54 | +1. In the Azure portal, navigate to your API Management service and select **Locations** from the left menu. |
| 55 | +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**. |
| 56 | +3. Confirm the deletion and select **Save** to apply the changes. |
50 | 57 |
|
51 | 58 | ## <a name="route-backend"> </a>Route API calls to regional backend services
|
52 | 59 |
|
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. |
| 60 | +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 | 61 |
|
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. |
| 62 | +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 | 63 |
|
57 |
| -1. Navigate to your Azure API Management instance and click on **APIs** from the left menu. |
| 64 | +1. Navigate to your Azure API Management instance and select **APIs** from the left menu. |
58 | 65 | 2. Select your desired API.
|
59 |
| -3. Click **Code editor** from the arrow dropdown in the **Inbound processing**. |
| 66 | +3. Select **Code editor** from the arrow dropdown in the **Inbound processing**. |
60 | 67 |
|
61 | 68 | 
|
62 | 69 |
|
63 | 70 | 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 | 71 |
|
65 |
| - For example, the below XML file would work for West US and East Asia regions: |
| 72 | + For example, the following XML file would work for West US and East Asia regions: |
66 | 73 |
|
67 | 74 | ```xml
|
68 | 75 | <policies>
|
@@ -97,14 +104,44 @@ To fully leverage geographical distribution of your system, you should have back
|
97 | 104 |
|
98 | 105 | ## <a name="custom-routing"> </a>Use custom routing to API Management regional gateways
|
99 | 106 |
|
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. |
| 107 | +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 | 108 |
|
102 | 109 | 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. |
| 110 | +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 | 111 | 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 | 112 | 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 | 113 | 1. Specify [the routing method](../traffic-manager/traffic-manager-routing-methods.md) of the Traffic Manager.
|
107 | 114 |
|
| 115 | +## Virtual networking |
| 116 | + |
| 117 | +This section provides considerations for using virtual networks in a multi-region deployment. |
| 118 | + |
| 119 | +In general, the prerequisites, configurations, and connectivity requirements for a virtual network in an added region are the same as those for a network in the primary region. |
| 120 | + |
| 121 | +For more information, seeL |
| 122 | + |
| 123 | +* [Connect to a virtual network using Azure API Management](api-management-using-with-vnet.md) |
| 124 | + |
| 125 | +* [Connect to a virtual network in internal mode using Azure API Management](api-management-using-with-internal-vnet.md) |
| 126 | + |
| 127 | +* [IP addresses of API Management](api-management-howto-ip-addresses.md) |
| 128 | + |
| 129 | + |
| 130 | +### External VNet mode |
| 131 | + |
| 132 | +* A public virtual IP address is created in every region added with a virtual network. This address is used for management traffic and for runtime API traffic. |
| 133 | + |
| 134 | + |
| 135 | +### Internal VNet mode |
| 136 | + |
| 137 | +* A public virtual IP address is created in every region added with a virtual network. This address is used for management traffic on port `3443`. |
| 138 | + |
| 139 | +* A private IP address is also created in every region added with a virtual network. These addresses are used to connect within the network to the service endpoints in the primary and secondary regions. |
| 140 | + |
| 141 | +* In 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 private load balancing across multiple regions. |
| 142 | + |
| 143 | +## Next steps |
| 144 | + |
108 | 145 | [create an api management service instance]: get-started-create-service-instance.md
|
109 | 146 | [get started with azure api management]: get-started-create-service-instance.md
|
110 | 147 | [deploy an api management service instance to a new region]: #add-region
|
|
0 commit comments