Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11444

How to deploy Azure Functions code

$
0
0

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 appsettingof 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

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 11444

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>