Migrate Azure API Management to availability zone support
The Azure API Management service supports availability zones in both zonal and zone-redundant configurations:
Zonal - the API Management gateway and the control plane of your API Management instance (management API, developer portal, Git configuration) are deployed in a single zone you select within an Azure region.
Zone-redundant - the gateway and the control plane of your API Management instance (management API, developer portal, Git configuration) are replicated across two or more physically separated zones within an Azure region. Zone redundancy provides resiliency and high availability to a service instance.
This article describes four scenarios for migrating an API Management instance to availability zones. For more information about configuring API Management for high availability, see Ensure API Management availability and reliability.
Prerequisites
To configure availability zones for API Management, your instance must be in one of the Azure regions that support availability zones.
If you don't have an API Management instance, create one by following the Create a new Azure API Management instance by using the Azure portal quickstart. Select the Premium service tier.
If you have an existing API Management instance, make sure that it's in the Premium tier. If it isn't, upgrade to the Premium tier.
If your API Management instance is deployed (injected) in an Azure virtual network, check the version of the compute platform (
stv1
orstv2
) that hosts the service.
Downtime requirements
There are no downtime requirements for any of the migration options.
Considerations
Changes can take 15 to 45 minutes to apply. The API Management gateway can continue to handle API requests during this time.
When you're migrating an API Management instance that's deployed in an external or internal virtual network to availability zones, you can optionally specify a new public IP address resource. In an internal virtual network, the public IP address is used only for management operations, not for API requests. Learn more about IP addresses of API Management.
Migrating to availability zones or changing the configuration of availability zones triggers a public and private IP address change.
When you're enabling availability zones in a region, you configure API Management scale units that you can distribute evenly across the zones. For example, if you configure two zones, you can configure two units, four units, or another multiple of two units.
Note
Use capacity metrics and your own testing to decide the number of scale units that will provide the gateway performance for your needs. Adding units incurs additional costs. Learn more about scaling and upgrading your service instance.
Note
When availability zones are configured for your API Management instance, under normal operating conditions all scale units in all configured zones are active and serve gateway traffic.
If you configured autoscaling for your API Management instance in the primary location, you might need to adjust your autoscale settings after configuring availability zones. The number of API Management units in autoscale rules and limits must be a multiple of the number of zones.
Existing gateway location not injected in a virtual network
To migrate an existing location of your API Management instance to availability zones when the instance is not injected in a virtual network:
In the Azure portal, go to your API Management instance.
On the Deployment + infrastructure menu, select Locations.
In the Location box, select the location to be migrated. The location must support availability zones, as mentioned earlier in the prerequisites.
In the Units box, select the number of scale units that you want in the location.
In the Availability zones box, select one or more zones. The number of units that you selected must be distributed evenly across the availability zones. For example, if you selected three units, select three zones so that each zone hosts one unit.
Select Apply, and then select Save.
Existing gateway location (stv1 platform) injected in a virtual network
To migrate an existing location of your API Management instance to availability zones when the instance is currently injected in a virtual network and is currently hosted on the stv1
platform, use the following steps. Migrating to availability zones also migrates the instance to the stv2
platform.
Create a new subnet and optional public IP address in the location to migrate to availability zones. Detailed requirements are in the virtual networking guidance.
In the Azure portal, go to your API Management instance.
On the Deployment + infrastructure menu, select Locations.
In the Location box, select the location to be migrated. The location must support availability zones, as mentioned earlier in the prerequisites.
In the Units box, select the number of scale units that you want in the location.
In the Availability zones box, select one or more zones. The number of units that you selected must be distributed evenly across the availability zones. For example, if you selected three units, select three zones so that each zone hosts one unit.
In the respective boxes under Network, select the new subnet and optional public IP address in the location.
Select Apply, and then select Save.
Existing gateway location (stv2 platform) injected in a virtual network
To migrate an existing location of your API Management instance to availability zones when the instance is currently injected in a virtual network and is already hosted on the stv2
platform:
Create a new subnet and optional public IP address in the location to migrate to availability zones. Detailed requirements are in the virtual networking guidance.
In the Azure portal, go to your API Management instance.
On the Deployment + infrastructure menu, select Locations.
In the Location box, select the location to be migrated. The location must support availability zones, as mentioned earlier in the prerequisites.
In the Units box, select the number of scale units that you want in the location.
In the Availability zones box, select one or more zones. The number of units that you selected must be distributed evenly across the availability zones. For example, if you selected three units, select three zones so that each zone hosts one unit.
In the Public IP Address box, optionally select the new public IP address in the location.
Select Apply, and then select Save.
New gateway location
To add a new location to your API Management instance and enable availability zones in that location:
If your API Management instance is deployed in a virtual network in the primary location, set up a virtual network, subnet, and optional public IP address in any new location where you plan to enable availability zones.
In the Azure portal, go to your API Management instance.
On the Deployment + infrastructure menu, select Locations.
Select + Add to add a new location. The location must support availability zones, as mentioned earlier in the prerequisites.
In the Units box, select the number of scale units that you want in the location.
In the Availability zones box, select one or more zones. The number of units that you selected must be distributed evenly across the availability zones. For example, if you selected three units, select three zones so that each zone hosts one unit.
If your API Management instance is deployed in a virtual network, use the boxes under Network to select the virtual network, subnet, and optional public IP address that are available in the location.
Select Add, and then select Save.