This project illustrates how an Azure Function can be deployed as IaC via Bicep.
The project provides the following Bicep templates:
- Function App (without settings)
- App Service Plan
- Storage Account
- Application Insights
- Key Vault
- Function App Settings
The individual resources can be found under the bicep/templates folder, these are all linked and deployed from the main.bicep file.
For more detailed information, please checkout my blog post 😃
- Azure Account with an active subscription. In case you do not have an Azure Account, go ahead and create one for free here
- Azure CLI
- Bicep Tools for Azure CLI and VS Code
The example parameter file looks like this:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"value": "stvm<storage-account-name>"
},
"storageAccountSku": {
"value": "Standard_LRS"
},
"applicationInsightsName": {
"value": "appi-<application-insights-name>"
},
"planName": {
"value": "plan-<plan-name>"
},
"planOS": {
"value": "Linux|Windows"
},
"functionAppName": {
"value": "func-<plan-name>"
},
"functionAppRuntime": {
"value": "dotnet|python|node|java"
},
"keyVaultName": {
"value": "kv-<key-vault-name>"
},
"keyVaultSku": {
"value": "standard"
},
"databaseConnectionString": {
"value": ""
}
}
}az group create -n <name> - <location>ℹ️ If you want to deploy to an existing resource group, you can skip this step.
az deployment group create \
--name <deployment-name> \
--resource-group <resource-group-name> \
--template-file bicep\main.bicep
--parameters @<path-to-parameters>ℹ️ Before using the deployment command, please call az login and specify the subscription you want to use.
Contributors names and contact info:
This project is licensed under the MIT License - see the LICENSE file for details.
