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
Dynamics 365 Business Central: Quickly find the Tenant ID, Azure AD Instance, and Tenant Scope from the domain (tenant) name without signing in
Hi, Readers.Today I would like to share another mini tip, how to quickly find the Tenant ID, Azure AD Instance, and Tenant Scope from the doma...
Starting Power BI deployment pipelines from Azure DevOps
Deployment pipelines in Power BI/ Microsoft Fabric have become crucial for managing and automating the deployment of Power BI content across e...
Video: Copilot Studio: Azure AI Search Complete Setup Guide
With Azure AI Search you can create a custom search engine of your company’s documents ... The post Video: Copilot Studio: Azure AI Search Com...
Microsoft Purview compliance portal: Endpoint Data Loss Prevention – Endpoint DLP support classification of Azure RMS protected Office documents
Endpoint DLP can now classify Office files stored in Windows devices that have Azure RMS protection applied. Classification will be triggered ...
Introducing Microsoft Azure Face Liveness
AI Builder – Use your own generative AI model from Azure AI Foundry in Prompt builder in Copilot Studio
We are announcing the ability to use your own generative AI model from Azure AI Foundry in prompt builder. This feature has reached general av...
Azure SDK Release (August 2025)
Azure SDK releases every month. In this post, you'll find this month's highlights and release notes. The post Azure SDK Release (August 2025) ...
Azure Developer CLI (azd) – August 2025
This post announces the August release of the Azure Developer CLI (`azd`). The post Azure Developer CLI (azd) – August 2025 appeared fir...