I´m looking at Azure Functions capabilities and the documentation does not say anything about uploading, creating or deleting a Function programmatically, nor anything about listing enabled/disabled Functions. Any ideas on how to do that? The Azure API reference has no section for Azure Functions.
2
-
This thread is a bit old and I don't have the complete solution yet, but I believe Kudu is your friend here. Try creating a function app through the portal, then explore the Kudu API to directly manage the function files to query, create, and update functions. The functions code is in D:\home\site\wwwroot (files of interest, 'function.json' and 'run.csx').Wagner DosAnjos– Wagner DosAnjos2019-07-29 12:26:57 +00:00Commented Jul 29, 2019 at 12:26
-
1Thanks for the idea. However, since then, Microsoft staff is strongly favouring zip deploy and even starting functions from zip packages. So I myself created a c# program that listens from source code changes in GitHub and prepares new zip deploy packages on-the-fly.Jaumir– Jaumir2019-07-30 23:43:08 +00:00Commented Jul 30, 2019 at 23:43
Add a comment
|
2 Answers
This functionality exists within the Azure CLI toolset.
- Here is a guide on creating functions via the CLI
- Documentation for the functions segment of Azure CLI
Hopefully these two resources should help get started. If you were looking for a publicly facing API, you may be out of luck.
1 Comment
Jaumir
I have looked at the documentation and indeed one can create or delete function apps, but I don´t see how I can create a function for an existing app, or delete a function without deleting the app, or simply to list the functions of an app. Could you please clarify? Thanks.
You can create functions from the cli using:
func new
Alternatively you can pass in some parameters (not required):
func new --language JavaScript --template HttpTrigger --name MyFunction
If you don't pass in the parameters, you are prompted with the questions and you can choose the correct options.
I've done deletion by removing the function specific folder and then deploying the application again.