Azure API Management with self-hosted gateway assosiated with Azure Function

Vasilis Melissaropoulos 20 Reputation points
2023-09-05T06:16:51.05+00:00

I have an Azure Function assosiated to APIM with a self-hosted gateway configured. Will the function run where the gateway is installed at or the gateway will ask Azure to execute the function in the cloud?

I'm trying to understand how the traffic works in this scenario.

The goal is to have some code to be http triggered and somehow keep the traffic internally and no data goes out to the cloud.

Is this possible?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,916 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,579 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,064 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 23,261 Reputation points
    2023-09-06T17:15:13.2266667+00:00

    Hi
    Vasilis Melissaropoulos
    Thanks for reaching out. A self-hosted gateway is a containerized version of the APIM gateway component that you can deploy to the same environments where you host your APIs, such as on-premises or in another cloud.

    The self-hosted gateway allows you to manage your APIs from a single APIM service in Azure, but improve the performance, security, and compliance of your API traffic by routing it directly to your backend APIs without going through Azure.

    Now, let’s assume that you have an Azure Function that is triggered by an HTTP request and that you have exposed this function as an API in your APIM service. You also have a self-hosted gateway deployed to your on-premises network, where you want to invoke the function from.

    1. The client sends an HTTP request to the self-hosted gateway, using the URL of the API that corresponds to the function.
    2. The self-hosted gateway validates the request, applies any policies, and forwards it to the Azure Function URL over the internet.
    3. The Azure Function executes the code and returns a response to the self-hosted gateway.
    4. The self-hosted gateway applies any policies and returns the response to the client.

    Therefore, in this scenario, the function will run in Azure, not where the gateway is installed. The gateway will only act as a proxy between the client and the function. This means that some data will go out to the cloud when you invoke the function.

    If you want to keep the traffic internally and avoid sending data to the cloud, you can deploy your Azure Function to your on-premises network. This way, you can run your function locally and use the self-hosted gateway to access it.

    I hope this helps you understand how the traffic works when you use a self-hosted gateway. Please let me know incase of further questions, I would be happy to assist you.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful