https://pulumi.com logo
Title
s

salmon-solstice-66768

03/11/2021, 2:23 PM
I am new to Pulumi. Can we create a azure function using pulumi_azure_native(python package)?
d

delightful-salesclerk-16161

03/11/2021, 2:28 PM
so you can definitely use azure functions in Pulumi
here is an example in typescript. we unfortunately don't have an example in python yet. https://github.com/pulumi/examples/blob/master/azure-ts-functions-many/index.ts
s

salmon-solstice-66768

03/11/2021, 2:34 PM
Thanks @delightful-salesclerk-16161 I saw the ts reference already.... but that doesn't directly create a function. Should we always use a WebAppFunction to create a function?
from pulumi_azure_native.streamanalytics.function import Function from pulumi_azure_native.web.web_app_function import WebAppFunction What is the difference between these two? Apologies if my question sounds naive
Just identified the first one is a ML function. Why is there no equivalents for a standard function 🤔
d

delightful-salesclerk-16161

03/11/2021, 2:40 PM
The streamanalytics function is actually a feature in Azure Stream Analytics where you can execute javascript functions
c

cool-fireman-90027

03/11/2021, 3:12 PM
You can use this as a template. Create a resource group in py Create a storage account in py Same for blob container and all the other resources. If you click on the resource you need here, you can change the language to python and build it.
🙌 1
w

worried-knife-31967

03/11/2021, 5:37 PM
A function is just a special "kind" of appservice in the Azure world. The APIs that you see in Pulumi correlate directly to the ARM equivalents under the hood. For a function, you need an appservice (of kind function) connected to an appservice plan (normally of sku dynamic Y1) and storage account connected to that appservice by an appsetting. There isn't (in the new azure native provider which the examples are based off) a "convenience" function that will create all the services for you, you have to do that manually. The example in Tusher's post will get you started with the above though.
👍 1
s

salmon-solstice-66768

03/15/2021, 12:52 AM
Thanks @cool-fireman-90027 & @worried-knife-31967