Azure function as a solution for redirecting URLs

Gurdev 0 Reputation points
2025-03-05T04:25:23.8933333+00:00

We have a requirement to redirect https://oldsystem.olddomain.com/<rest of the path> to https://newsystem.newdomain.com/<rest of the path>. I am thinking to use Azure function for this. I have created the function with required logic but I need the https://oldsystem.olddomain.com to invoke this function no matter what the rest of the path is. My research suggested proxies as a way to achieve it but then proxies have been deprecated and replaced with Azure API Management.

How do I go about configuring FuntionApp / APIM to achieve this? The function app has only one function.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,504 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shireesha Eeraboina 1,900 Reputation points Microsoft External Staff
    2025-03-05T07:50:42.8733333+00:00

    Hi Gurdev,

    Welcome to Microsoft Q&A Platform!

    To implement URL redirection from https://oldsystem.olddomain.com/<rest of the path> to https://newsystem.newdomain.com/<rest of the path> using Azure Functions, you can utilize an Azure API Management (APIM) instance to direct requests to your function app. Here’s a straightforward approach:

    • Create an API Management Instance: If you haven't done so already, set up an APIM instance in Azure.
    • Import Your Function App: Import your Azure Function into the APIM instance as an API.
    • Configure a Rewrite Rule: Establish a rewrite rule in APIM to redirect requests from https://oldsystem.olddomain.com/<rest of the path> to https://newsystem.newdomain.com/<rest of the path>. This can be achieved by creating a policy that alters the request URL.
    • Test the Configuration: Verify that requests to the old domain are successfully redirected to the new domain.

    This configuration enables you to manage the redirection without depending on the deprecated proxy's feature.

    For your reference, please review the following documentations for further clarification:

    I hope this answers your query! Let me know if you require any additional help or clarification.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.