Traffic Manager Integration with Azure API Management - 404 resource not found error
To implement disaster recovery and high availability for API backends we can either place traffic manager or front door services in front of APIM.
Traffic Manager is a DNS based global load balancing solution. It is accessed via the http://<domain>.trafficmanager.net URL.
Most often users comes across the following issue during Traffic Manager implementation
{
"statusCode": 404,
"message": "Resource not found"
}
The above is because Traffic Manager is not able to handle layer 7 traffic correctly.
This article provides step by step guidance on Traffic manager for managing disaster recovery of APIs across two regions.
We have used APIM premium SKU with gateway deployed in Central India and South India regions as shown in the screenshot below
Configure Inbound Routing Policy in the API definition created inside APIM and specify the regional backend URLs of your APIs. This is required for APIM to internally manage the routing.
As a next step create a Traffic Manager profile and configure the Central India and South India APIM gateway URLs as backend endpoints .
Configure the APIM healthcheck URLs in Traffic Manager configuration navigation to ensure the endpoints are running healthy.
For Traffic Manager to effectively route traffic to APIM endpoints you need to first create a certificate for the complete Traffic Manager domain name "<domain>.trafficmanager.net"
You can use utility such as “mkcert” to generate a certificate file. Use the versions appropriate to your operating system.
Rename the .p12 certificate file .pfx and save it in a secured location. Note the password generated in the above process.
Now associate this certificate with APIM custom domains.
Navigate to APIM->Custom domain and click the add button. Type the traffic manager DNS name in the hostname section and chose certificate type as custom. Select the certificate from the saved location and provide the certificate password (generated at the time of creating the certificate). Select “Default SSL Binding” checkbox and save the settings.
Now open a new browser session and type in the traffic manager URL of your API application and it will get routed by the API management to the correct regional endpoint.
Successful routing to primary region as shown below
Successful routing to secondary region as shown below
Published on:
Learn moreRelated posts
Announcing Azure MCP Server 1.0.0 Stable Release – A New Era for Agentic Workflows
Today marks a major milestone for agentic development on Azure: the stable release of the Azure MCP Server 1.0! The post Announcing Azure MCP ...
From Backup to Discovery: Veeam’s Search Engine Powered by Azure Cosmos DB
This article was co-authored by Zack Rossman, Staff Software Engineer, Veeam; Ashlie Martinez, Staff Software Engineer, Veeam; and James Nguye...
Azure SDK Release (October 2025)
Azure SDK releases every month. In this post, you'll find this month's highlights and release notes. The post Azure SDK Release (October 2025)...
Microsoft Copilot (Microsoft 365): [Copilot Extensibility] No-Code Publishing for Azure AI Foundry Agents to Microsoft 365 Copilot Agent Store
Developers can now publish Azure AI Foundry Agents directly to the Microsoft 365 Copilot Agent Store with a simplified, no-code experience. Pr...
Azure Marketplace and AppSource: A Unified AI Apps and Agents Marketplace
The Microsoft AI Apps and Agents Marketplace is set to transform how businesses discover, purchase, and deploy AI-powered solutions. This new ...
Episode 413 – Simplifying Azure Files with a new file share-centric management model
Welcome to Episode 413 of the Microsoft Cloud IT Pro Podcast. Microsoft has introduced a new file share-centric management model for Azure Fil...
Bringing Context to Copilot: Azure Cosmos DB Best Practices, Right in Your VS Code Workspace
Developers love GitHub Copilot for its instant, intelligent code suggestions. But what if those suggestions could also reflect your specific d...
Build an AI Agentic RAG search application with React, SQL Azure and Azure Static Web Apps
Introduction Leveraging OpenAI for semantic searches on structured databases like Azure SQL enhances search accuracy and context-awareness, pr...
Announcing latest Azure Cosmos DB Python SDK: Powering the Future of AI with OpenAI
We’re thrilled to announce the stable release of Azure Cosmos DB Python SDK version 4.14.0! This release brings together months of innov...