An Azure service that provides an event-driven serverless compute platform.
anonymous user Thank you for reaching out to Microsoft Q&A. Apologize for my previous comment about LinuxfxVerison we have tested the below bicep template and it is working fine. You can use the below Bicep template to deploy consumption plan function app which is running with 'Python|3.9'
@description('The name of the function app that you wish to create.')
param appName string = '<functionAppName>'
param storageAccountType string = 'Standard_LRS'
@description('Location for all resources.')
param location string = 'west us'
@description('Location for Application Insights')
param appInsightsLocation string = location
var hostingPlanName = appName
var applicationInsightsName = appName
var storageAccountName = '<strgaccountName>'
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
name: storageAccountName
location: location
sku: {
name: storageAccountType
}
kind: 'StorageV2'
}
resource hostingPlan 'Microsoft.Web/serverfarms@2021-03-01' = {
name: hostingPlanName
location: location
kind:'linux'
sku: {
name: 'Y1'
tier: 'Dynamic'
size: 'Y1'
family: 'Y'
}
properties: {
reserved: true
}
}
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
name: applicationInsightsName
location: appInsightsLocation
kind: 'web'
properties: {
Application_Type: 'web'
Request_Source: 'rest'
}
}
resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
name: appName
location: location
kind: 'functionapp,linux'
identity: {
type: 'SystemAssigned'
}
properties: {
serverFarmId: hostingPlan.id
reserved:true
siteConfig: {
appSettings: [
{
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
value: applicationInsights.properties.ConnectionString
}
{
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${listkeys(storageAccount.id,storageAccount.apiVersion).keys[0].value};EndpointSuffix=${environment().suffixes.storage};'
}
{
name: 'FUNCTIONS_EXTENSION_VERSION'
value: '~4'
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'python'
}
]
linuxFxVersion:'Python|3.9'
ftpsState:'Disabled'
minTlsVersion:'1.2'
}
httpsOnly:true
}
}
You can refer to this documentation, about which properties under site config need to be used based on the function app plan type (whether consumption plan, elastic premium plan or App service plan) this documentation talks about the ARM template but this implies the same for the Bicep template as well.
have an app that is created on VSCode, can I somehow deploy it automatically with Bicep or from GitHub?
You can follow these documentation steps on how to deploy Bicep template through visual studio code.
Incase if you face any issue while deploying the above template, please let me know so that I can connect with you to assist you further.