Deploying Python Function Apps through Bicep #5833
-
Hello! I am attempting to replicate the deployment process described here https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=azurecli-linux%2Capplication-level using bicep but have hit a few roadblocks.
Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Bicep is great for creating Azure Resource Types, which are known as Resource Providers. E,g, such as a ServerFarm (App Service Plan) or a Website (App Service). resource FARM 'Microsoft.Web/serverfarms@2021-02-01' existing = {
...
}
resource WS 'Microsoft.Web/sites@2021-01-01' = {
...
} These are pre-requisite to deploying Applications or in this case I would recommend:
They will allow you to create and deploy function apps from command line and templates. You will be creating some files on your local filesystem, then you have the ability to publish them, via a zipdeploy to the app service. This should get you started and also give you the ability to write your custom code within the function. By the way, you can also create the Function app itself with these above tools, which will setup a variety of App Config settings for the language of your choice depending on the template that you selected. Once you have a working solution, it's easier to reverse engineer some of the bits into a Bicep Template. One method that I like is to get the ResourceID of the function, then in VSCode, you can select the command palatte, then "Bicep: Insert Resource", then you paste in the resourceID and it will paste in the Bicep code into your bicep file in vscode.
|
Beta Was this translation helpful? Give feedback.
Bicep is great for creating Azure Resource Types, which are known as Resource Providers. E,g, such as a ServerFarm (App Service Plan) or a Website (App Service).
These are pre-requisite to deploying Applications or in this case
WebSite
Content AKAyour Function app
, which includes those files that you referenced.I would recommend:
To create a function instead of Bicep.exe try out Func.exe
https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash
Or Try the VSCode extension for managing functions.
ht…