Loading...

Traffic Manager Integration with Azure API Management - 404 resource not found error

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

PrachiTrivedi_0-1694145780379.png

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.

PrachiTrivedi_6-1694145780454.png

 

As a next step create a Traffic Manager profile and configure the Central India and South India APIM gateway URLs as backend endpoints .

PrachiTrivedi_2-1694149264186.png

 

PrachiTrivedi_1-1694145780390.png

 

PrachiTrivedi_2-1694145780398.png

Configure the APIM healthcheck URLs in Traffic Manager configuration navigation to ensure the endpoints are running healthy.

PrachiTrivedi_3-1694145780414.png

 

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.

PrachiTrivedi_4-1694145780424.png

 

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.

PrachiTrivedi_5-1694145780435.png

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

PrachiTrivedi_7-1694145957279.png

Successful routing to secondary region as shown below

PrachiTrivedi_8-1694146000735.png

 

Published on:

Learn more
Azure Infrastructure Blog articles
Azure Infrastructure Blog articles

Azure Infrastructure Blog articles

Share post:

Related posts

GitHub Secret Protection and GitHub Code Security for Azure DevOps

Following the changes to GitHub Advanced Security on GitHub, we’re launching the standalone security products of GitHub Secret Protectio...

3 hours ago

Powering Real-Time Messaging at Scale with Azure Cosmos DB

Microsoft Teams, Copilot, Azure Communication Services and many other product offerings from Microsoft, rely on a unified messaging platform t...

2 days ago

Azure SQL Cryptozoology AI Embeddings Lab Now Available!

Missed out on MS Build 2025? No worries! Our lab is now available for your exploration. Dive into a unique cryptozoology experience using Azur...

3 days ago

Vector Support Public Preview now extended to Azure SQL MI

We are thrilled to announce that Azure SQL Managed Instance now supports Vector type and functions in public preview.  This builds on the mome...

4 days ago

Building Multi-Agent AI Apps in Java with Spring AI and Azure Cosmos DB!

As AI-driven apps become more sophisticated, there’s an increasing need for them to mimic collaborative problem solving – like a t...

4 days ago

What runs ChatGPT, Sora, DeepSeek & Llama on Azure? (feat. Mark Russinovich)

Build and run your AI apps and agents at scale with Azure. Orchestrate multi-agent apps and high-scale inference solutions using open-source a...

4 days ago

Azure Cosmos DB TV – Everything New in Azure Cosmos DB from Microsoft Build 2025

Microsoft Build 2025 brought major innovations to Azure Cosmos DB, and in Episode 105 of Azure Cosmos DB TV, Principal Program Manager Mark Br...

4 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy