HomeAbout Me

Azure API Management (APIM) | Internal Mode | Forced Tunneling | Connectivity Error | Virtual Appliance

By Sri Gunnala
Published in Microsoft Azure
February 12, 2025
2 min read
Azure API Management (APIM) | Internal Mode | Forced Tunneling | Connectivity Error | Virtual Appliance

Deploying Azure API Management (APIM) in internal mode provides enhanced security by restricting access to internal virtual networks. However, organizations often enforce forced tunneling to route all outbound internet-bound traffic from APIM through on-premises security appliances for inspection and auditing. While this improves security, it can inadvertently break APIM’s connectivity to Azure services, causing operational disruptions.


The Problem: Connectivity Break with Forced Tunneling

When forced tunneling is implemented, a route table (UDR) is attached to the subnet where APIM is deployed. This UDR defines a default route (0.0.0.0/0) that forces all outbound traffic from APIM to flow through an on-premises firewall or Network Virtual Appliance.

As a result, critical control plane traffic (used for managing APIM via Azure) is either blocked or rerouted incorrectly, breaking APIM’s connectivity to Azure services.

Impact

  • APIM becomes unresponsive because it cannot communicate with Azure management services.
  • Platform updates and scaling operations fail due to the lack of outbound connectivity.
  • Azure monitoring tools such as Application Insights, Azure Monitor, and Log Analytics stop receiving data.

If you don’t explicitly allow control plane traffic, APIM cannot function properly, leading to degraded service or complete outages.


Why Forced Tunneling is Implemented

Organizations implement forced tunneling for various security and compliance reasons:

  • To inspect and audit outbound internet traffic.
  • To enforce on-premises security policies for cloud services.
  • To prevent accidental data exfiltration by ensuring all traffic passes through on-premises security appliances.

However, while this approach enhances security, it requires careful configuration to avoid breaking Azure service dependencies like APIM.


The Fix: Adding a Route for Control Plane Traffic

To restore APIM connectivity while maintaining forced tunneling, you need to explicitly allow control plane traffic by adding an exception route in the UDR.

Steps to Fix the Issue:

  1. Identify APIM Control Plane Dependencies

    • The APIM control plane requires access to Azure services like management.azure.com and global.apim.azure-api.net.
    • These services must be allowed for APIM to function correctly.
  2. Modify the Route Table (UDR)

    • Add a new route in the UDR attached to the APIM subnet.
    • Define the destination address prefix as ApiManagement.
    • Set the next hop type as Internet, ensuring that control plane traffic bypasses the forced tunnel.
  3. Example Route Table Entry

    Below is an example route table configuration:

    NameAddress PrefixNext Hop TypeNext Hop IP Address
    apim-controlplaneApiManagementInternet-
    AzureMonitor-to-InternetAzureMonitorInternet-
    default-to-firewall0.0.0.0/0Virtual Appliance10.46.0.228
    • The apim-controlplane route allows APIM control plane traffic to reach Azure services.
    • The AzureMonitor-to-Internet route ensures that Azure monitoring services can still function.
    • The default-to-firewall route enforces forced tunneling for all other traffic.
  4. Apply the Updated Route Table

    • Ensure the updated UDR is associated with the APIM subnet.
    • Validate the changes by testing outbound connectivity to management.azure.com.
  5. Test APIM Functionality

    • Use nslookup or tracert to verify if APIM traffic is correctly routed.
    • Monitor APIM logs and Azure Monitor to confirm connectivity restoration.

Conclusion

Forced tunneling is a powerful security feature, but improper configuration can break critical Azure services like APIM.
By allowing control plane traffic to bypass forced tunneling, you can maintain both security and functionality.

With the correct route table configuration, APIM will continue to operate seamlessly while meeting compliance and security requirements. 🚀

Have you faced similar issues with forced tunneling and APIM? Let me know in the comments!

thumbnail credits

Tags

#Azure#APIM
Previous Article
Azure APIM Caching Policy | Cache-lookup Policy | HTTP GET | Non-Cache HTTP POST
Sri Gunnala

Sri Gunnala

Learner | Reader | Blogger | Azure Enthusiast

Topics

Microsoft Azure
Front End
Microsoft .NET

Newsletter

Sri Gunnala - Make sure to subscribe to newsletter and be the first to know the news.

Related Posts

Azure APIM Caching Policy | Cache-lookup Policy | HTTP GET | Non-Cache HTTP POST
September 21, 2024
2 min

Legal Stuff

Privacy NoticeCookie PolicyTerms Of Use

Social Media