Last active
May 24, 2025 10:51
-
-
Save prasann/a6b96dc262646b71c07e1456aa92faf3 to your computer and use it in GitHub Desktop.
Bicep to deploy an app to Az function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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