Azure SDK Python

Domagoj Bazina 201 Reputation points
2022-06-01T13:17:32.113+00:00

Hello,
I'm trying to create Azure Function App using Azure Python SDK.
But I can't find example for that in documentation (https://learn.microsoft.com/en-us/azure/developer/python/sdk/examples/azure-sdk-example-resource-group).

Is it even possible to do that, or just example is missing.

Thanks :)

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. Bruno Lucas 4,436 Reputation points MVP
    2022-06-02T08:45:34.4+00:00

    Hi @Domagoj Bazina

    Do you want to write a Azure Function using Python SDK or create an Function App (the azure function host) using Python SDK?
    To create an Function App using Python you could use this API: https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-function same way you invoke any API. If there is an sdk approach it could be probably using this API underneath

    This is not exact for the create function but same base:
    https://lnx.azurewebsites.net/azure-resource-manager-api-calls-from-python/

    I suspect there is no option for function app under the sdk. There is "web app": https://learn.microsoft.com/en-us/azure/developer/python/sdk/examples/azure-sdk-example-web-app?tabs=cmd

    I would have to be under this namespace:
    207843-image.png

    I may be missing but I can find anything for Function apps: https://azure.github.io/azure-sdk/releases/latest/mgmt/python.html


2 additional answers

Sort by: Most helpful
  1. rbrundritt 20,836 Reputation points Microsoft Employee Moderator
    2022-06-01T16:58:57.137+00:00

  2. Domagoj Bazina 201 Reputation points
    2022-06-07T10:21:46.047+00:00

    Hello,
    @Bruno Lucas , I've realized that something you have mentioned above is exactly what I need.

    To create an Function App using Python you could use this API: https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-function

    This API call should create a function to the existing Function App, but the problem is that it is not documented properly. There are a bunch of body parameters to be sent, but I can't find to what those parameters are related to. Also, I've tried to search for example, or something like that, but nothing I can find...

    Besides, this API call makes me wonder how to choose which type of Trigger to use, how to send source code of the script, etc...

    Thanks in advance for any provided info !


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.