Calling Azure Function from APIM backend

PK 316 Reputation points
2021-06-10T05:36:39.247+00:00

Hello,

There is endpoint we have configured in APIM which will be hit by the client. In the APIM policies for the API, we have defined the message body to be routed to a service bus topic.

Now, I need to configure APIM backend API to call an Azure Function I will be handling message body routing to the service bus. I could see only logic apps in the list of options, and could not see Azure Functions.

Is there a way we can call Azure Function in the APIM backend?

Thanks,
PK

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,782 questions
Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
553 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 68,656 Reputation points
    2021-06-10T06:09:40.757+00:00

    Hi @PK

    Please confirm my understanding:
    APIM --> Azure function (backend call) --> Azure function sending message to service bus

    Yes, you can create your function app and import an function app as an API in APIM. Can you share the screenshot where you don't see the option to import function app in APIM.

    If the scenario is APIM --> Azure function (to modify the body) --> APIM backend call to service bus REST API
    Then you can use Send request advanced policy to call the HTTP function and your APIM backend will be calling the service bus REST API.

    Update 6/11:
    @PK I will get the confirmation from my team if this is supported yet as I don't see the option from azure portal when you navigate to the Backend for a particular API. When we import an function as an APIM there are multiple other configuration that are created for you in your APIM resource. For now you need to create the Backend and configure it in your API.

    104678-image.png

    In the Inbound you need to set the set-backend-service policy for your API methods.

    Update 6/14:
    I have got the confirmation from my team that the option to select the backend as function on the existing API's/operation option is not currently available.
    In future they will try to add this functionality and improve the backend entities interface overall but there's no specific timeline just yet.