Deploy Azure Function App using Project Bicep

project bicep ... an arm dsl

Chendrayan Venkatesan

2 minute read


Refer to the below links to know more about the project bicep

  1. GitHub

    1. Repository
    2. Docs
    3. Examples
    4. Tutorials
    5. Specifications
  2. YouTube

    1. Intro to Azure’s Project Bicep with Brendan Burns and team
    2. Project Bicep Demo at Ignite 2020 by Mark Russinovich
    3. Project Bicep and ARM Templates November 2020 Update


Project Bicep is growing well, and I am using it at my workplace to build proof of concepts environments. In my last blog post, I showed how to use bicep in Azure DevOps. Now, let me show the steps to deploy the Azure Function app using project bicep.


  1. Azure Account.
  2. Contributor Permission on Azure subscriptions.
  3. Resource Group
    1. rg-azeusfunctionappdev01

Note: The first time I made a mistake – I ignored kind=’Function App'. So, it created a web app. Redeploying by adding kind ended up with the below error.

Status Message: Consumption pricing tier cannot be used for regular web apps. (Code: Conflict)
 - Consumption pricing tier cannot be used for regular web apps. (Code:)
 -  (Code:Conflict)
 -  (Code:)

Solution: Clear the resource group and redeploy it!

Bicep Code

var location = resourceGroup().location
var suffix = 'azeusfunctionappdev01'

resource storage_account 'Microsoft.Storage/storageAccounts@2020-08-01-preview' = {
  name: 'stg${suffix}'
  location: location
  properties: {
    supportsHttpsTrafficOnly: true
    minimumTlsVersion: 'TLS1_2'
  kind: 'StorageV2'
  sku: {
    name: 'Standard_LRS'
    tier: 'Standard'

resource hosting_plan 'Microsoft.Web/serverfarms@2020-06-01' = {
  name: 'asp-${suffix}'
  location: location
  sku: {
    name: 'Y1'
    tier: 'Dynamic'

resource function_app 'Microsoft.Web/sites@2020-06-01' = {
  name: 'functionapp-${suffix}'
  location: location
  kind: 'functionapp'
  properties: {
    httpsOnly: true
    clientAffinityEnabled: true
    siteConfig: {
      appSettings: [
          'value': '~3'
          'name': 'FUNCTIONS_WORKER_RUNTIME'
          'value': 'powershell'
          value: 'DefaultEndpointsProtocol=https;AccountName=${};EndpointSuffix=${environment()};AccountKey=${listKeys(, storage_account.apiVersion).keys[0].value}'
          name: 'WEBSITE_CONTENTSHARE'
          value: '${substring(uniqueString(resourceGroup().id), 3)}-azeus-functionapp-dev01'
          name: 'AzureWebJobsStorage'
          value: 'DefaultEndpointsProtocol=https;AccountName=${};AccountKey=${listKeys(, storage_account.apiVersion)};'

  dependsOn: [

Build Bicep

PS C:\> build bicep .\main.bicep


PS C:\> New-AzResourceGroupDeployment -ResourceGroupName "rg-azeusfunctionappdev01" -TemplateFile .\Main.json -Debug



comments powered by Disqus