Hi everbody,
i am a little confused on how to deploy a function app properly with ZIP deployment.
Currently I have:
const asset = new TerraformAsset(this, 'function-asset', {
path: resolve(__dirname, 'dist/out.zip'),
type: AssetType.ARCHIVE,
})
new StorageBlob(this, 'appcode', {
name: 'functionapp.zip',
storageAccountName: sa.name,
storageContainerName: sc.name,
type: 'block',
source: asset.path,
})
const sp = new AppServicePlan(this, 'appSp', {
location: rg.location,
name: 'cdktf-app-service-plan',
resourceGroupName: rg.name,
sku: [{ size: 'Y1', tier: 'Dynamic' }],
kind: 'FunctionApp',
})
new FunctionApp(this, 'faId', {
appServicePlanId: sp.id,
location: rg.location,
name: 'cdktf-fa-name',
resourceGroupName: rg.name,
storageAccountName: sa.name,
storageAccountAccessKey: sa.primaryAccessKey,
version: '~3',
})
but how can the StorageBlob
be linked to the function app? Normaly ou would like to do a so called ZIP deployment and set the appsetting
of the function to WEBSITE_RUN_FROM_PACKAGE=1
to increase startup time on windows etc.
Does anybody have an exampe for azure, I only can find examples for AWS Lambda.
Thanks a lot
regards
Mathias