{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "logicAppFEname": { "type": "String" }, "use32BitWorkerProcess": { "type": "Bool" }, "location": { "defaultValue": "[resourceGroup().location]", "type": "String", "metadata": { "description": "Location to deploy resources to." } }, "subnetNameForPrivateEndpoint": { "type": "string" }, "hostingPlanFEName": { "type": "String" }, "contentStorageAccountName": { "type": "String" }, "sku": { "type": "String" }, "skuCode": { "type": "String" }, "workerSize": { "type": "String" }, "workerSizeId": { "type": "String" }, "numberOfWorkers": { "type": "String" }, "vnetName": { "defaultValue": "VirtualNetwork", "type": "String", "metadata": { "description": "Name of the VNET that the Function App and Storage account will communicate over." } }, "subnetName": { "type": "String" } }, "variables": { "privateEndpointFileStorageName": "[concat(parameters('contentStorageAccountName'), '-fileshare-pe')]", "privateEndpointBlobStorageName": "[concat(parameters('contentStorageAccountName'), '-blob-pe')]", "privateEndpointQueueStorageName": "[concat(parameters('contentStorageAccountName'), '-queue-pe')]", "privateEndpointTableStorageName": "[concat(parameters('contentStorageAccountName'), '-table-pe')]", "fileShareName": "[parameters('logicAppFEname')]", "privateEndPointForLogicApp": "[concat(parameters('logicAppFEname'), '-logicapp-pe')]" }, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2021-04-01", "name": "[parameters('contentStorageAccountName')]", "location": "[parameters('Location')]", "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "StorageV2", "properties": { "networkAcls": { "bypass": "AzureServices", "defaultAction": "Deny" }, "supportsHttpsTrafficOnly": true, "encryption": { "services": { "file": { "keyType": "Account", "enabled": true }, "blob": { "keyType": "Account", "enabled": true } }, "keySource": "Microsoft.Storage" } } }, { "type": "Microsoft.Storage/storageAccounts/fileServices/shares", "apiVersion": "2021-04-01", "name": "[concat(parameters('contentStorageAccountName'), '/default/', toLower(variables('fileShareName')))]", "dependsOn": [ "[parameters('contentStorageAccountName')]" ] }, //Private Endpoint { "type": "Microsoft.Network/privateEndpoints", "apiVersion": "2020-06-01", "name": "[variables('privateEndpointFileStorageName')]", "location": "[parameters('Location')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', parameters('contentStorageAccountName'), 'default',toLower(variables('fileShareName')))]" ], "properties": { "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetNameForPrivateEndpoint') )]" }, "privateLinkServiceConnections": [ { "name": "MyStorageQueuePrivateLinkConnection", "properties": { "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('contentStorageAccountName'))]", "groupIds": [ "file" ] } } ] } }, { "type": "Microsoft.Network/privateEndpoints", "apiVersion": "2020-06-01", "name": "[variables('privateEndpointBlobStorageName')]", "location": "[parameters('Location')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', parameters('contentStorageAccountName'), 'default', toLower(variables('fileShareName')))]" ], "properties": { "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetNameForPrivateEndpoint') )]" }, "privateLinkServiceConnections": [ { "name": "MyStorageQueuePrivateLinkConnection", "properties": { "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('contentStorageAccountName'))]", "groupIds": [ "blob" ] } } ] } }, { "type": "Microsoft.Network/privateEndpoints", "apiVersion": "2020-06-01", "name": "[variables('privateEndpointQueueStorageName')]", "location": "[parameters('Location')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', parameters('contentStorageAccountName'), 'default', toLower(variables('fileShareName')))]" ], "properties": { "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetNameForPrivateEndpoint'))]" }, "privateLinkServiceConnections": [ { "name": "MyStorageQueuePrivateLinkConnection", "properties": { "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('contentStorageAccountName'))]", "groupIds": [ "queue" ] } } ] } }, { "type": "Microsoft.Network/privateEndpoints", "apiVersion": "2020-06-01", "name": "[variables('privateEndpointTableStorageName')]", "location": "[parameters('Location')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', parameters('contentStorageAccountName'), 'default', toLower(variables('fileShareName')))]" ], "properties": { "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetNameForPrivateEndpoint'))]" }, "privateLinkServiceConnections": [ { "name": "MyStorageQueuePrivateLinkConnection", "properties": { "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('contentStorageAccountName'))]", "groupIds": [ "table" ] } } ] } }, { "type": "Microsoft.Network/privateEndpoints", "apiVersion": "2020-06-01", "name": "[variables('privateEndPointForLogicApp')]", "location": "[parameters('Location')]", "properties": { "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetNameForPrivateEndpoint'))]" }, "privateLinkServiceConnections": [ { "name": "MyStorageQueuePrivateLinkConnection", "properties": { "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', parameters('logicAppFEname'))]", // Logic app resource id "groupIds": [ "sites" ] } } ] }, "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', parameters('contentStorageAccountName'), 'default',toLower(variables('fileShareName')))]", "[resourceId('Microsoft.Web/sites/', parameters('logicAppFEname'))]" ] }, { "type": "Microsoft.Insights/components", "apiVersion": "2020-02-02", "name": "[parameters('logicAppFEname')]", "location": "[parameters('Location')]", "kind": "web", "properties": { "Application_Type": "web" } }, { "type": "Microsoft.Web/sites", "apiVersion": "2018-11-01", "name": "[parameters('logicAppFEname')]", "location": "[parameters('location')]", "dependsOn": [ "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanFEName'))]" ], "tags": {}, "kind": "functionapp,workflowapp", "identity": { "type": "SystemAssigned" }, "properties": { "name": "[parameters('logicAppFEname')]", "siteConfig": { "appSettings": [ { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~3" }, { "name": "FUNCTIONS_WORKER_RUNTIME", "value": "node" }, { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(resourceId('Microsoft.Insights/components', parameters('logicAppFEname')), '2015-05-01').InstrumentationKey]" }, { "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", "value": "[reference(resourceId('Microsoft.Insights/components', parameters('logicAppFEname')), '2015-05-01').ConnectionString]" }, { "name": "AzureWebJobsStorage", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('contentStorageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('contentStorageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]" }, { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('contentStorageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('contentStorageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]" }, { "name": "WEBSITE_CONTENTSHARE", "value": "[toLower(variables('fileShareName'))]" }, { "name": "APP_KIND", "value": "workflowApp" }, { "name": "WEBSITE_VNET_ROUTE_ALL", "value": "1" }, { "name": "AzureFunctionsJobHost__extensionBundle__id", "value": "Microsoft.Azure.Functions.ExtensionBundle.Workflows", "slotSetting": false }, { "name": "AzureFunctionsJobHost__extensionBundle__version", "value": "2.0", "slotSetting": false }, { "name": "WEBSITE_CONTENTOVERVNET", "value": "1", "slotSetting": false } ], "use32BitWorkerProcess": "[parameters('use32BitWorkerProcess')]", "cors": { "allowedOrigins": [ "https://afd.hosting.portal.azure.net", "https://afd.hosting-ms.portal.azure.net", "https://hosting.portal.azure.net", "https://ms.hosting.portal.azure.net", "https://ema-ms.hosting.portal.azure.net", "https://ema.hosting.portal.azure.net", "https://ema.hosting.portal.azure.net" ] } }, "serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', parameters('hostingPlanFEName'))]", "clientAffinityEnabled": true }, "resources": [ { "type": "networkconfig", "apiVersion": "2018-11-01", "name": "virtualNetwork", "location": "[parameters('location')]", "dependsOn": [ "[parameters('logicAppFEname')]" ], "properties": { "subnetResourceId": "[resourceId('Microsoft.Network/virtualNetworks/subnets',parameters('vnetName'), parameters('subnetName'))]", "swiftSupported": true } } ] }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2018-11-01", "name": "[parameters('hostingPlanFEName')]", "location": "[parameters('location')]", "dependsOn": [], "tags": {}, "sku": { "Tier": "[parameters('sku')]", "Name": "[parameters('skuCode')]" }, "kind": "", "properties": { "name": "[parameters('hostingPlanFEName')]", "workerSize": "[parameters('workerSize')]", "workerSizeId": "[parameters('workerSizeId')]", "numberOfWorkers": "[parameters('numberOfWorkers')]", "maximumElasticWorkerCount": "20" } } ] }