Skip to content

Instantly share code, notes, and snippets.

@prasann
Last active May 24, 2025 10:51
Show Gist options
  • Save prasann/a6b96dc262646b71c07e1456aa92faf3 to your computer and use it in GitHub Desktop.
Save prasann/a6b96dc262646b71c07e1456aa92faf3 to your computer and use it in GitHub Desktop.
Bicep to deploy an app to Az function
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "1911219512878221344"
}
},
"parameters": {
"functionAppName": {
"type": "string",
"defaultValue": "demoFunctionApp"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
}
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2022-03-01",
"name": "[parameters('functionAppName')]",
"location": "[parameters('location')]",
"kind": "functionapp",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', format('{0}-plan', parameters('functionAppName')))]"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', format('{0}-plan', parameters('functionAppName')))]"
]
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2022-03-01",
"name": "[format('{0}-plan', parameters('functionAppName'))]",
"location": "[parameters('location')]",
"sku": {
"name": "Y1",
"tier": "Dynamic"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2022-09-01",
"name": "[uniqueString(resourceGroup().id, parameters('functionAppName'))]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
},
"kind": "StorageV2"
}
],
"outputs": {
"functionAppEndpoint": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Web/sites', parameters('functionAppName')), '2022-03-01').defaultHostName]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment