How to create Azure function using REST API ?

Domagoj Bazina 201 Reputation points
2022-06-09T10:09:23.533+00:00

Greetings everyone,
I've been trying to create Azure function using REST API, link to the documentation (https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-function). There is an example in the documentation, but it lacks additional information about body parameters.

Does anyone have an example of POST request to create Azure function, that includes body parameters?

There are two requests in this case:

  1. Create & deploy Azure Function App, and then create & deploy sub-function (HTTP trigger, Time trigger, etc...) to it.
  2. Create & deploy sub-function to the previously created Function App.

The second request is the one I'm looking for.

Thanks !

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

Accepted answer
  1. MughundhanRaveendran-MSFT 12,481 Reputation points
    2022-06-14T06:14:37.103+00:00

    Hi @Domagoj Bazina ,

    Thanks for reaching out to Q&A forum.

    The document that you are referring is to create a function app. This is only a management operation. The same rest api cannot be used to deploy the functions/code. Please follow the below document to deploy functions/code to a Function app that is created already.

    https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push#rest

    I hope this helps! Feel free to reach out to me if you have any queries or concerns.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Randi Ratnayake 76 Reputation points
    2022-06-09T15:29:14.397+00:00

    First of all, this isn't anything to do with API-M so you can take that tag off.

    Secondly, I am not sure architecturally that what you are trying to do is scalable and maintainable. What I see is you must have some orchestrator function that responds to the events and invokes different functions depending on your event type/ requirement to execute different kinds of logic. I strongly recommend you to look into durable functions


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.