{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "eventHubNamespaceName": { "type": "string", "metadata": { "description": "The name of the EventHub namespace" } }, "eventHubName": { "type": "string", "metadata": { "description": "The name of the Event Hub" } }, "sqlServerName": { "type": "string", "metadata": { "description": "Name of the SQL Server" } }, "sqlServerUserName": { "type": "string", "metadata": { "description": "The administrator username of the SQL Server" } }, "sqlServerPassword": { "type": "securestring", "metadata": { "description": "The administrator password of the SQL Server" } }, "sqlServerDatabaseName": { "type": "string", "metadata": { "description": "The name of the SQL Server database" } }, "storageName": { "type": "string", "metadata": { "description": "The name of the storage account" } }, "functionAppName": { "type": "string", "metadata": { "description": "The name of the function app" } } }, "variables": { "blobContainerName": "windturbinecapture", "functionAppPlanName": "[concat(parameters('functionAppName'),'Plan')]", "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', parameters('storageName'))]" }, "resources": [ { "type": "Microsoft.EventHub/namespaces", "apiVersion": "2017-04-01", "name": "[parameters('eventHubNamespaceName')]", "location": "[resourceGroup().location]", "sku": { "name": "Standard" }, "properties": { "isAutoInflateEnabled": "true", "maximumThroughputUnits": "7" }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageName'))]" ], "resources": [ { "type": "EventHubs", "apiVersion": "2017-04-01", "name": "[parameters('eventHubName')]", "dependsOn": [ "[concat('Microsoft.EventHub/namespaces/', parameters('eventHubNamespaceName'))]" ], "properties": { "messageRetentionInDays": "1", "partitionCount": "2", "captureDescription": { "enabled": "true", "encoding": "Avro", "intervalInSeconds": "60", "sizeLimitInBytes": "314572800", "destination": { "name": "EventHubArchive.AzureBlockBlob", "properties": { "storageAccountResourceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageName'))]", "blobContainer": "[variables('blobContainerName')]", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}" } } } } } ] }, { "type": "Microsoft.Sql/servers", "apiVersion": "2014-04-01", "name": "[parameters('sqlServerName')]", "location": "[resourceGroup().location]", "scale": null, "properties": { "administratorLogin": "[parameters('sqlServerUserName')]", "administratorLoginPassword": "[parameters('sqlServerPassword')]", "version": "12.0" }, "resources": [ { "type": "databases", "apiVersion": "2017-10-01-preview", "name": "[parameters('sqlServerDatabaseName')]", "location": "[resourceGroup().location]", "sku": { "name": "DW100c", "tier": "DataWarehouse" }, "properties": { "collation": "SQL_Latin1_General_CP1_CI_AS" }, "dependsOn": [ "[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]" ] }, { "type": "firewallRules", "apiVersion": "2014-04-01", "name": "AllowAllAzureIps", "location": "[resourceGroup().location]", "dependsOn": [ "[parameters('sqlServerName')]" ], "properties": { "endIpAddress": "0.0.0.0", "startIpAddress": "0.0.0.0" } } ] }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2016-01-01", "name": "[parameters('storageName')]", "location": "[resourceGroup().location]", "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "Storage", "tags": {}, "scale": null, "properties": {}, "dependsOn": [] }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2015-08-01", "name": "[variables('functionAppPlanName')]", "location": "[resourceGroup().location]", "kind": "functionapp", "sku": { "name": "Y1", "tier": "Dynamic", "size": "Y1", "family": "Y", "capacity": 0 }, "properties": { "name": "[variables('functionAppPlanName')]", "numberOfWorkers": 0 } }, { "type": "Microsoft.Web/sites", "apiVersion": "2016-08-01", "name": "[parameters('functionAppName')]", "location": "[resourceGroup().location]", "kind": "functionapp", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('functionAppPlanName'))]", "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageName'))]" ], "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('functionAppPlanName'))]", "siteConfig": { "appSettings": [ { "name": "AzureWebJobsDashboard", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]" }, { "name": "AzureWebJobsStorage", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]" }, { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]" }, { "name": "WEBSITE_CONTENTSHARE", "value": "[toLower(parameters('functionAppName'))]" }, { "name": "StorageConnectionString", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]" }, { "name": "SqlDwConnection", "value": "[concat('Server=tcp:',parameters('sqlServerName'),'.database.windows.net,1433;Database=', parameters('sqlServerDatabaseName'), ';Trusted_Connection=False;User ID=',parameters('sqlServerUserName'),'@',parameters('sqlServerName'),';Password=',parameters('sqlServerPassword'),';Connection Timeout=30;Encrypt=True')]" }, { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~1" }, { "name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "6.5.0" } ] } } } ] }