A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/api-management/api-management-using-with-internal-vnet below:

Deploy Azure API Management instance to internal VNet

APPLIES TO: Developer | Premium

Azure API Management can be deployed (injected) inside an Azure virtual network (VNet) to access backend services within the network. For VNet connectivity options, requirements, and considerations, see:

This article explains how to set up VNet connectivity for your API Management instance in the internal mode. In this mode, you can only access the following API Management endpoints within a VNet whose access you control.

Note

Use API Management in internal mode to:

For configurations specific to the external mode, where the API Management endpoints are accessible from the public internet, and backend services are located in the network, see Deploy your Azure API Management instance to a virtual network - external mode.

Important

Changes to your API Management service's infrastructure (such as configuring custom domains, adding CA certificates, scaling, virtual network configuration, availability zone changes, and region additions) can take 15 minutes or longer to complete, depending on the service tier and the size of the deployment. Expect longer times for an instance with a greater number of scale units or multi-region configuration. Rolling changes to API Management are executed carefully to preserve capacity and availability.

While the service is updating, other service infrastructure changes can't be made. However, you can configure APIs, products, policies, and user settings. The service will not experience gateway downtime, and API Management will continue to service API requests without interruption (except in the Developer tier).

Prerequisites

Review the network resource requirements for API Management injection into a virtual network before you begin.

Enable VNet connection Enable VNet connectivity using the Azure portal
  1. Go to the Azure portal to find your API management instance. Search for and select API Management services.
  2. Choose your API Management instance.
  3. Select Network > Virtual network.
  4. Select the Internal access type.
  5. In the list of locations (regions) where your API Management service is provisioned:
    1. Choose a Location.
    2. Select Virtual network and Subnet.
      • The VNet list is populated with Resource Manager VNets available in your Azure subscriptions, set up in the region you are configuring.
  6. Select Apply. The Virtual network page of your API Management instance is updated with your new VNet and subnet choices.
  7. Continue configuring VNet settings for the remaining locations of your API Management instance.
  8. In the top navigation bar, select Save.

After successful deployment, you should see your API Management service's private virtual IP address and public virtual IP address on the Overview blade. For more information about the IP addresses, see Routing in this article.

Note

Since the gateway URL is not registered on the public DNS, the test console available on the Azure portal will not work for an internal VNet deployed service. Instead, use the test console provided on the developer portal.

Enable connectivity using a Resource Manager template Configure NSG rules

Configure custom network rules in the API Management subnet to filter traffic to and from your API Management instance. We recommend the following minimum NSG rules to ensure proper operation and access to your instance. Review your environment carefully to determine more rules that might be needed.

Important

Depending on your use of caching and other features, you may need to configure additional NSG rules beyond the minimum rules in the following table. For detailed settings, see Virtual network configuration reference.

Direction Source service tag Source port ranges Destination service tag Destination port ranges Protocol Action Purpose VNet type Inbound Internet * VirtualNetwork [80], 443 TCP Allow Client communication to API Management External only Inbound ApiManagement * VirtualNetwork 3443 TCP Allow Management endpoint for Azure portal and PowerShell External & Internal Inbound AzureLoadBalancer * VirtualNetwork 6390 TCP Allow Azure Infrastructure Load Balancer External & Internal Inbound AzureTrafficManager * VirtualNetwork 443 TCP Allow Azure Traffic Manager routing for multi-region deployment External only Outbound VirtualNetwork * Internet 80 TCP Allow Validation and management of Microsoft-managed and customer-managed certificates External & Internal Outbound VirtualNetwork * Storage 443 TCP Allow Dependency on Azure Storage for core service functionality External & Internal Outbound VirtualNetwork * SQL 1433 TCP Allow Access to Azure SQL endpoints for core service functionality External & Internal Outbound VirtualNetwork * AzureKeyVault 443 TCP Allow Access to Azure Key Vault for core service functionality External & Internal Outbound VirtualNetwork * AzureMonitor 1886, 443 TCP Allow Publish Diagnostics Logs and Metrics, Resource Health, and Application Insights External & Internal DNS configuration

In internal VNet mode, you have to manage your own DNS to enable inbound access to your API Management endpoints.

We recommend:

  1. Configure an Azure DNS private zone.
  2. Link the Azure DNS private zone to the VNet into which you've deployed your API Management service.

Learn how to set up a private zone in Azure DNS.

Note

The API Management service does not listen to requests on its IP addresses. It only responds to requests to the hostname configured on its endpoints. These endpoints include:

Access on default host names

When you create an API Management service (contosointernalvnet, for example), the following endpoints are configured by default:

Endpoint Endpoint configuration API Gateway contosointernalvnet.azure-api.net Developer portal contosointernalvnet.portal.azure-api.net The new developer portal contosointernalvnet.developer.azure-api.net Direct management endpoint contosointernalvnet.management.azure-api.net Git contosointernalvnet.scm.azure-api.net Access on custom domain names

If you don't want to access the API Management service with the default host names, set up custom domain names for all your endpoints, as shown in the following image:

Configure DNS records

Create records in your DNS server to access the endpoints accessible from within your VNet. Map the endpoint records to the private virtual IP address for your service.

For testing purposes, you might update the hosts file on a virtual machine in a subnet connected to the VNet in which API Management is deployed. Assuming the private virtual IP address for your service is 10.1.0.5, you can map the hosts file as follows. The hosts mapping file is at %SystemDrive%\drivers\etc\hosts (Windows) or /etc/hosts (Linux, macOS).

Internal virtual IP address Endpoint configuration 10.1.0.5 contosointernalvnet.azure-api.net 10.1.0.5 contosointernalvnet.portal.azure-api.net 10.1.0.5 contosointernalvnet.developer.azure-api.net 10.1.0.5 contosointernalvnet.management.azure-api.net 10.1.0.5 contosointernalvnet.scm.azure-api.net

You can then access all the API Management endpoints from the virtual machine you created.

Routing

The following virtual IP addresses are configured for an API Management instance in an internal virtual network.

Virtual IP address Description Private virtual IP address A load balanced IP address from within the API Management instance's subnet range (DIP), over which you can access the API gateway, developer portal, management, and Git endpoints.

Register this address with the DNS servers used by the VNet.

Public virtual IP address Used only for control plane traffic to the management endpoint over port 3443. Can be locked down to the ApiManagement service tag.

The load-balanced public and private IP addresses can be found on the Overview blade in the Azure portal.

For more information and considerations, see IP addresses of Azure API Management.

VIP and DIP addresses

Dynamic IP (DIP) addresses will be assigned to each underlying virtual machine in the service and used to access endpoints and resources in the VNet and in peered VNets. The API Management service's public virtual IP (VIP) address will be used to access public-facing resources.

If IP restriction lists secure resources within the VNet or peered VNets, we recommend specifying the entire subnet range where the API Management service is deployed to grant or restrict access from the service.

Learn more about the recommended subnet size.

Example

If you deploy 1 capacity unit of API Management in the Premium tier in an internal VNet, 3 IP addresses will be used: 1 for the private VIP and one each for the DIPs for two VMs. If you scale out to 4 units, more IPs will be consumed for additional DIPs from the subnet.

If the destination endpoint has allow-listed only a fixed set of DIPs, connection failures will result if you add new units in the future. For this reason and since the subnet is entirely in your control, we recommend allow-listing the entire subnet in the backend.

Force tunnel traffic to on-premises firewall using ExpressRoute or network virtual appliance

Forced tunneling lets you redirect or "force" all internet-bound traffic from your subnet back to on-premises for inspection and auditing. Commonly, you configure and define your own default route (0.0.0.0/0), forcing all traffic from the API Management subnet to flow through an on-premises firewall or to a network virtual appliance. This traffic flow breaks connectivity with API Management, since outbound traffic is either blocked on-premises, or NAT'd to an unrecognizable set of addresses that no longer work with various Azure endpoints. You can solve this issue via the following methods:

For more information, see Virtual network configuration reference.

Common network configuration issues

This section has moved. See Virtual network configuration reference.

Troubleshooting Unsuccessful initial deployment of API Management service into a subnet

Important

After validating the connectivity, remove all the resources in the subnet before deploying API Management into the subnet.

Verify network status Filter Description Required Select to review the required Azure services connectivity for API Management. Failure indicates that the instance is unable to perform core operations to manage APIs. Optional Select to review the optional services connectivity. Failure indicates only that the specific functionality won't work (for example, SMTP). Failure may lead to degradation in using and monitoring the API Management instance and providing the committed SLA.

To help troubleshoot connectivity issues, select:

To address connectivity issues, review network configuration settings and fix required network settings.

Incremental updates

When making changes to your network, refer to NetworkStatus API to verify that the API Management service hasn't lost access to critical resources. The connectivity status should be updated every 15 minutes.

To apply a network configuration change to the API Management instance using the portal:

  1. In the left-hand menu for your instance, under Deployment and infrastructure, select Network > Virtual network.
  2. Select Apply network configuration.
Challenges encountered in reassigning API Management instance to previous subnet Troubleshoot connection to Microsoft Graph from inside a VNet

Network connectivity to Microsoft Graph is needed for features including user sign-in to the developer portal using the Microsoft Entra identity provider.

To troubleshoot connectivity to Microsoft Graph from inside a VNet:

Learn more about:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4