{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "appName": { "type": "string", "metadata": { "description": "The name of the function app that you wish to create." } }, "storageAccountType": { "type": "string", "defaultValue": "Standard_LRS", "allowedValues": [ "Standard_LRS", "Standard_GRS", "Standard_RAGRS" ], "metadata": { "description": "Storage Account type" } }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location for all resources." } }, "appInsightsLocation": { "type": "string", "metadata": { "description": "Location for Application Insights" } }, "runtime": { "type": "string", "defaultValue": "python", "allowedValues": [ "python" ], "metadata": { "description": "The language worker runtime to load in the function app." } } }, "variables": { "functionAppName": "[parameters('appName')]", "hostingPlanName": "[parameters('appName')]", "applicationInsightsName": "[parameters('appName')]", "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'azfunctions')]", "functionWorkerRuntime": "[parameters('runtime')]" }, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "name": "[variables('storageAccountName')]", "location": "[parameters('location')]", "sku": { "name": "[parameters('storageAccountType')]" }, "kind": "Storage" }, { "type": "Microsoft.Web/sites", "apiVersion": "2020-06-01", "name": "[variables('functionAppName')]", "location": "[parameters('location')]", "kind": "functionapp,linux", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ], "properties": { "siteConfig": { "appSettings": [ { "name": "AzureWebJobsStorage", "value":"[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';EndpointSuffix=',environment().suffixes.storage,';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value)]" }, { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~3" }, { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(resourceId('microsoft.insights/components', variables('applicationInsightsName')), '2020-02-02-preview').InstrumentationKey]" }, { "name": "FUNCTIONS_WORKER_RUNTIME", "value": "[variables('functionWorkerRuntime')]" } ] }, "reserved": true } }, { "type": "microsoft.insights/components", "apiVersion": "2020-02-02-preview", "name": "[variables('applicationInsightsName')]", "location": "[parameters('appInsightsLocation')]", "tags": { "[concat('hidden-link:', resourceId('Microsoft.Web/sites', variables('applicationInsightsName')))]": "Resource" }, "properties": { "ApplicationId": "[variables('applicationInsightsName')]", "Request_Source": "IbizaWebAppExtensionCreate" } } ] }