If I Add Endpoints to an Azure Function, Do I Need to Import it into API Management Again?

Nassirpour, Matthew@DGS 46 Reputation points
2022-08-02T21:39:49.237+00:00

I am using Azure API Management. I imported an Azure Function into it, which configured all of the endpoint links for me. If another developer updates the underlying Function and adds more endpoints, will APIM pick that up automatically, or will I have to manually append them every time? If so, what's the best way to automate this process? ARM?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
0 comments No comments
{count} votes

Accepted answer
  1. James Longworth 326 Reputation points
    2022-08-04T10:14:48.537+00:00

    I think it comes down to how you are deploying currently and how that process can be extended. As you state, using the portal's 'import' functionality is just an automated method of creating an API in APIM which references the backend function. This is a 'point-in-time' view and, while there now appears to be a link between the backend API and the API definition in APIM, it is not a dynamic link - just an imported API based upon specific definitions of the back-end, named-values etc. So, if you update your back-end with a new endpoint then you need to add this manually in APIM (or potentially re-import). What you need to do is create a process that dynamically updates the API management front-end endpoints for your API when the code changes and a new endpoint is added / something is changed.

    You mention use of CI/CD. Take a look at this article. It uses YAML CI/CD pipelines to generate an OpenAPI definition of the API (In the article's case it is a webapi) from the startup assembly as part of CI, and then uses this OpenAPI spec to then update the API management instance as part of the CD stages. It may be an approach that you can adopt to achieve what you are looking for.

    automating-your-openapi-updates-to-api-management-through-your-cicd-pipeline

    Good Luck!


1 additional answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 29,261 Reputation points
    2022-08-03T16:53:17.547+00:00

    Hi @Nassirpour, Matthew@DGS Thanks for reaching out. From the description I understand that you wanted to know is there a way to import an azure function automatically please refer this blog post which explains importing Azure function app to APIM Programmatically https://techcommunity.microsoft.com/t5/azure-paas-blog/import-azure-function-app-to-azure-api-management/ba-p/2594810

    please let me know incase of further queries, I would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


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.