{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "functionAppName": { "type": "string", "defaultValue": "[concat('fnapp', uniqueString(resourceGroup().id))]", "metadata": { "description": "Specifies the name of the Azure Functions app." } }, "hostingPlanName": { "type": "string", "defaultValue": "[concat(parameters('functionAppName'), 'HostingPlan')]", "metadata": { "description": "Specifies the name of the hosting plan." } }, "applicationInsightsName": { "type": "string", "defaultValue": "[concat(parameters('functionAppName'), 'ApplicationInsights')]", "metadata": { "description": "Specifies the name of the Application Insights used by Azure Functions." } }, "vmDiagnosticStorageAccountName": { "type": "string", "defaultValue": "[concat('boot', uniquestring(resourceGroup().id))]", "metadata": { "description": "Specifies the name of the storage account used to store the boot diagnostics logs of the virtual machine." } }, "webJobsStorageAccountName": { "type": "string", "defaultValue": "[concat('webjobs', uniquestring(resourceGroup().id))]", "metadata": { "description": "Specifies the name of the storage account referenced by the AzureWebJobsStorage setting." } }, "functionAppContentStorageAccountName": { "type": "string", "defaultValue": "[concat('func', uniquestring(resourceGroup().id))]", "metadata": { "description": "Specifies the name of the storage account containing the application code." } }, "cosmosDbAccountName": { "type": "string", "defaultValue": "[concat('cosmosdb', uniqueString(resourceGroup().id))]", "metadata": { "description": "Specifies the name of the Azure Cosmos Db account." } }, "cosmosDbDatabaseName": { "type": "string", "defaultValue": "Repository", "metadata": { "description": "Specifies the name of the Azure Cosmos Db database." } }, "cosmosDbContainerName": { "type": "string", "defaultValue": "Messages", "metadata": { "description": "Specifies the name of the Azure Cosmos Db container." } }, "vmName": { "type": "string", "defaultValue": "TestVm", "metadata": { "description": "Specifies the name of the virtual machine." } }, "vmSize": { "type": "string", "defaultValue": "Standard_DS3_v2", "metadata": { "description": "Specifies the size of the virtual machine." } }, "imagePublisher": { "type": "string", "defaultValue": "MicrosoftWindowsDesktop", "metadata": { "description": "Specifies the image publisher of the disk image used to create the virtual machine." } }, "imageOffer": { "type": "string", "defaultValue": "Windows-10", "metadata": { "description": "Specifies the offer of the platform image or marketplace image used to create the virtual machine." } }, "imageSku": { "type": "string", "defaultValue": "rs5-pro", "metadata": { "description": "Specifies the Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version." } }, "adminUsername": { "type": "string", "defaultValue": "azadmin", "metadata": { "description": "Specifies the name of the administrator account of the virtual machine." } }, "adminPasswordOrKey": { "type": "securestring", "metadata": { "description": "Specifies the SSH Key or password for the virtual machine. SSH key is recommended." } }, "diskStorageAccounType": { "type": "string", "defaultValue": "Premium_LRS", "allowedValues": [ "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", "Standard_GZRS", "Standard_RAGZRS" ], "metadata": { "description": "Specifies the storage account type for OS and data disk." } }, "numDataDisks": { "type": "int", "defaultValue": 1, "minValue": 0, "maxValue": 64, "metadata": { "description": "Specifies the number of data disks of the virtual machine." } }, "osDiskSize": { "type": "int", "defaultValue": 127, "metadata": { "description": "Specifies the size in GB of the OS disk of the VM." } }, "dataDiskSize": { "type": "int", "defaultValue": 50, "metadata": { "description": "Specifies the size in GB of the OS disk of the virtual machine." } }, "dataDiskCaching": { "type": "string", "defaultValue": "ReadWrite", "metadata": { "description": "Specifies the caching requirements for the data disks." } }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Specifies the location for all the resources." } }, "virtualNetworkName": { "defaultValue": "TestVnet", "type": "string", "metadata": { "description": "Specifies the name of the virtual network hosting the virtual machine." } }, "virtualNetworkAddressPrefix": { "defaultValue": "10.0.0.0/16", "type": "string", "metadata": { "description": "Specifies the address prefix of the virtual network hosting Azure Functions and other resources." } }, "functionSubnetName": { "defaultValue": "FunctionSubnet", "type": "string", "metadata": { "description": "Specifies the name of the subnet hosting Azure Functions." } }, "privateEndpointSubnetName": { "defaultValue": "PrivateEndpointSubnet", "type": "string", "metadata": { "description": "Specifies the name of the subnet hosting private endpoints." } }, "virtualMachineSubnetName": { "defaultValue": "VirtualMachineSubnet", "type": "string", "metadata": { "description": "Specifies the name of the subnet hosting virtual machines." } }, "bastionSubnetName": { "defaultValue": "AzureBastionSubnet", "type": "string", "metadata": { "description": "Specifies the name of the subnet hosting Azure Bastion." } }, "functionSubnetAddressPrefix": { "defaultValue": "10.0.0.0/24", "type": "string", "metadata": { "description": "Specifies the address prefix of the subnet hosting Azure Functions." } }, "privateEndpointSubnetAddressPrefix": { "defaultValue": "10.0.1.0/24", "type": "string", "metadata": { "description": "Specifies the address prefix of the subnet hosting private endpoints." } }, "virtualMachineSubnetAddressPrefix": { "defaultValue": "10.0.2.0/24", "type": "string", "metadata": { "description": "Specifies the address prefix of the subnet hosting virtual machines." } }, "bastionSubnetAddressPrefix": { "defaultValue": "10.0.3.0/27", "type": "string", "metadata": { "description": "Specifies the address prefix of the subnet hosting Azure Bastion." } }, "vmDiagnosticStorageAccountPrivateEndpointName": { "defaultValue": "VmDiagnosticLogsStorageAccountPrivateEndpoint", "type": "string", "metadata": { "description": "Specifies the name of the private endpoint to the storage account used for boot diagnostic logs of the virtual machine." } }, "webJobsBlobStorageAccountPrivateEndpointName": { "defaultValue": "WebJobsBlobStorageAccountPrivateEndpoint", "type": "string", "metadata": { "description": "Specifies the name of the private endpoint to the blob service of the web jobs storage account." } }, "webJobsFileStorageAccountPrivateEndpointName": { "defaultValue": "WebJobsFileStorageAccountPrivateEndpoint", "type": "string", "metadata": { "description": "Specifies the name of the private endpoint to the file service of the web jobs storage account." } }, "webJobsTableStorageAccountPrivateEndpointName": { "defaultValue": "WebJobsTableStorageAccountPrivateEndpoint", "type": "string", "metadata": { "description": "Specifies the name of the private endpoint to the table service of the web jobs storage account." } }, "webJobsQueueStorageAccountPrivateEndpointName": { "defaultValue": "WebJobsQueueStorageAccountPrivateEndpoint", "type": "string", "metadata": { "description": "Specifies the name of the private endpoint to the queue service of the web jobs storage account." } }, "cosmosDbPrivateEndpointName": { "defaultValue": "CosmosDbPrivateEndpoint", "type": "string", "metadata": { "description": "Specifies the name of the private endpoint to Cosmos DB." } }, "bastionHostName": { "type": "string", "defaultValue": "[concat(parameters('functionAppName'), 'Bastion')]", "metadata": { "description": "Specifies the name of the Azure Bastion resource." } }, "workspaceName": { "type": "string", "defaultValue": "[concat('loganalytics', uniqueString(resourceGroup().id))]", "metadata": { "description": "Specifies the globally unique name of the Log Analytics workspace." } }, "workspaceSku": { "type": "string", "allowedValues": [ "PerGB2018", "Free", "Standalone", "PerNode", "Standard", "Premium" ], "defaultValue": "PerGB2018", "metadata": { "description": "Specifies the SKU of the Log Analytics workspace." } }, "serviceBusNamespaceName": { "type": "string", "defaultValue": "[concat('servicebus', uniquestring(resourceGroup().id))]", "metadata": { "description": "Specifies the name of the Service Bus namespace." } }, "serviceBusNamespaceZoneRedundant": { "type": "bool", "defaultValue": true, "metadata": { "description": "Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones." } }, "serviceBusNamespaceCapacity": { "type": "int", "defaultValue": 1, "metadata": { "description": "Specifies the messaging units for the Service Bus namespace. For Premium tier, capacity are 1,2 and 4." } }, "serviceBusQueueName": { "type": "string", "defaultValue": "requests", "metadata": { "description": "Specifies the name of the Service Bus queue used by the Azure Functions app." } }, "serviceBusNamespacePrivateEndpointName": { "type": "string", "defaultValue": "ServiceBusNamespacePrivateEndpoint", "metadata": { "description": "Specifies the name of the private link to the storage account." } }, "natGatewayName": { "defaultValue": "[concat(parameters('functionAppName'), 'NatGateway')]", "type": "String", "metadata": { "description": "Specifies the name of the NAT gateway resource" } }, "publicIPPrefixName": { "type": "string", "defaultValue": "[concat(parameters('natGatewayName'), 'PubliIpPrefix')]", "metadata": { "description": "Specifies the name of the public IP prefix." } }, "publicIPPrefixLength": { "type": "int", "defaultValue": 28, "minValue": 28, "maxValue": 31, "metadata": { "description": "Specifies the length of the public IP prefix." } } }, "variables": { "storageFileDNSZoneForwarder": "[concat('.file.', environment().suffixes.storage)]", "storageBlobDNSZoneForwarder": "[concat('.blob.', environment().suffixes.storage)]", "storageTableDNSZoneForwarder": "[concat('.table.', environment().suffixes.storage)]", "storageQueueDNSZoneForwarder": "[concat('.queue.', environment().suffixes.storage)]", "cosmosDbDNSZoneForwarder": "[if(equals(toLower(environment().name), 'azureusgovernment'), '.documents.azure.us', '.documents.azure.com')]", "serviceBusPublicDNSZoneForwarder": "[if(equals(toLower(environment().name), 'azureusgovernment'), '.servicebus.usgovcloudapi.net', '.servicebus.windows.net')]", "storageFilePrivateDnsZoneName": "[concat('privatelink', variables('storageFileDNSZoneForwarder'))]", "storageBlobPrivateDnsZoneName": "[concat('privatelink', variables('storageBlobDNSZoneForwarder'))]", "storageTablePrivateDnsZoneName": "[concat('privatelink', variables('storageTableDNSZoneForwarder'))]", "storageQueuePrivateDnsZoneName": "[concat('privatelink', variables('storageQueueDNSZoneForwarder'))]", "cosmosDbPrivateDnsZoneName": "[concat('privatelink', variables('cosmosDbDNSZoneForwarder'))]", "serviceBusNamespacePrivateDnsZoneName": "[concat('privatelink', variables('serviceBusPublicDNSZoneForwarder'))]", "storageFilePrivateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('storageFilePrivateDnsZoneName'))]", "storageBlobPrivateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('storageBlobPrivateDnsZoneName'))]", "storageTablePrivateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('storageTablePrivateDnsZoneName'))]", "storageQueuePrivateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('storageQueuePrivateDnsZoneName'))]", "cosmosDbPrivateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('cosmosDbPrivateDnsZoneName'))]", "serviceBusNamespacePrivateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('serviceBusNamespacePrivateDnsZoneName'))]", "vmDiagnosticStorageAccountPrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('vmDiagnosticStorageAccountPrivateEndpointName'))]", "webJobsBlobStorageAccountPrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('webJobsBlobStorageAccountPrivateEndpointName'))]", "webJobsFileStorageAccountPrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('webJobsFileStorageAccountPrivateEndpointName'))]", "webJobsTableStorageAccountPrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('webJobsTableStorageAccountPrivateEndpointName'))]", "webJobsQueueStorageAccountPrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('webJobsQueueStorageAccountPrivateEndpointName'))]", "cosmosDbPrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('cosmosDbPrivateEndpointName'))]", "serviceBusNamespacePrivateEndpointId": "[resourceId('Microsoft.Network/privateEndpoints', parameters('serviceBusNamespacePrivateEndpointName'))]", "vmDiagnosticStorageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('vmDiagnosticStorageAccountName'))]", "webJobsStorageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('webJobsStorageAccountName'))]", "functionAppContentStorageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('functionAppContentStorageAccountName'))]", "cosmosDbDatabaseName": "[concat(toLower(parameters('cosmosDbAccountName')), '/', parameters('cosmosDbDatabaseName'))]", "cosmosDbDatabaseContainerName": "[concat(toLower(parameters('cosmosDbAccountName')), '/', parameters('cosmosDbDatabaseName'), '/', parameters('cosmosDbContainerName'))]", "cosmosDbAccountId": "[resourceId('Microsoft.DocumentDB/databaseAccounts', toLower(parameters('cosmosDbAccountName')))]", "cosmosDbDatabaseId": "[resourceId('Microsoft.DocumentDB/databaseAccounts/sqlDatabases', toLower(parameters('cosmosDbAccountName')), parameters('cosmosDbDatabaseName'))]", "serviceBusNamespaceId": "[resourceId('Microsoft.ServiceBus/namespaces', parameters('serviceBusNamespaceName'))]", "publicIPPrefixId": "[resourceId('Microsoft.Network/publicIPPrefixes', parameters('publicIPPrefixName'))]", "natGatewayId": "[resourceId('Microsoft.Network/natGateways', parameters('natGatewayName'))]", "serviceBusNamespaceDefaultSASKeyName": "RootManageSharedAccessKey", "serviceBusNamespaceAuthRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', parameters('serviceBusNamespaceName'), variables('serviceBusNamespaceDefaultSASKeyName'))]", "vmNicName": "[concat(parameters('vmName'), 'Nic')]", "vmSubnetNsgName": "[concat(parameters('virtualMachineSubnetName'), 'Nsg')]", "bastionPublicIPAddressName": "BastionPublicIp", "bastionPublicIPAddressId": "[resourceId('Microsoft.Network/publicIPAddresses', variables('bastionPublicIPAddressName'))]", "dnsLabelPrefix": "[concat('vm', uniqueString(resourceGroup().id))]", "bastionHostId": "[resourceId('Microsoft.Network/bastionHosts', parameters('bastionHostName'))]", "vmNicId": "[resourceId('Microsoft.Network/networkInterfaces', variables('vmNicName'))]", "vnetId": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", "vmSubnetNsgId": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('vmSubnetNsgName'))]", "vmId": "[resourceId('Microsoft.Compute/virtualMachines', parameters('vmName'))]", "functionAppId": "[resourceId('Microsoft.Web/sites', parameters('functionAppName'))]", "hostingPlanId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]", "workspaceId": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspaceName'))]", "applicationInsightsId": "[resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))]", "virtualMachineSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('virtualMachineSubnetName'))]", "bastionSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('bastionSubnetName'))]", "functionSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('functionSubnetName'))]", "privateEndpointSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('privateEndpointSubnetName'))]" }, "resources": [ { "type": "Microsoft.Network/publicIPPrefixes", "apiVersion": "2018-07-01", "name": "[parameters('publicIPPrefixName')]", "location": "[parameters('location')]", "sku": { "name": "Standard", "tier": "Regional" }, "properties": { "prefixLength": "[parameters('publicIPPrefixLength')]", "publicIPAddressVersion": "IPv4" } }, { "type": "Microsoft.Network/natGateways", "apiVersion": "2020-06-01", "name": "[parameters('natGatewayName')]", "location": "[parameters('location')]", "sku": { "name": "Standard" }, "dependsOn": [ "[variables('publicIPPrefixId')]" ], "properties": { "idleTimeoutInMinutes": 4, "publicIpPrefixes": [ { "id": "[variables('publicIPPrefixId')]" } ] } }, { "apiVersion": "2018-01-01-preview", "name": "[parameters('serviceBusNamespaceName')]", "type": "Microsoft.ServiceBus/namespaces", "location": "[parameters('location')]", "sku": { "name": "Premium", "tier": "Premium", "capacity": "[parameters('serviceBusNamespaceCapacity')]" }, "properties": { "zoneRedundant": "[parameters('serviceBusNamespaceZoneRedundant')]" }, "resources": [ { "name": "[parameters('serviceBusQueueName')]", "type": "queues", "apiVersion": "2017-04-01", "dependsOn": [ "[variables('serviceBusNamespaceId')]" ], "properties": { "lockDuration": "PT5M", "maxSizeInMegabytes": 1024, "requiresDuplicateDetection": false, "requiresSession": false, "defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S", "deadLetteringOnMessageExpiration": false, "duplicateDetectionHistoryTimeWindow": "PT10M", "maxDeliveryCount": 10, "autoDeleteOnIdle": "P10675199DT2H48M5.4775807S", "enablePartitioning": false, "enableExpress": false } } ] }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "location": "[parameters('location')]", "name": "[parameters('functionAppContentStorageAccountName')]", "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "StorageV2", "properties": { "networkAcls": { "bypass": "AzureServices", "defaultAction": "Allow" }, "supportsHttpsTrafficOnly": true } }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('vnetId')]" ], "name": "[parameters('webJobsStorageAccountName')]", "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "StorageV2", "properties": { "networkAcls": { "bypass": "AzureServices", "defaultAction": "Deny" }, "supportsHttpsTrafficOnly": true } }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "name": "[parameters('vmDiagnosticStorageAccountName')]", "location": "[parameters('location')]", "sku": { "name": "Standard_LRS" }, "kind": "StorageV2", "properties": { } }, { "type": "Microsoft.Network/virtualNetworks", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "[parameters('virtualNetworkName')]", "dependsOn": [ "[variables('vmSubnetNsgId')]" ], "properties": { "addressSpace": { "addressPrefixes": [ "[parameters('virtualNetworkAddressPrefix')]" ] }, "subnets": [ { "name": "[parameters('functionSubnetName')]", "properties": { "addressPrefix": "[parameters('functionSubnetAddressPrefix')]", "natGateway": { "id": "[variables('natGatewayId')]" }, "privateEndpointNetworkPolicies": "Enabled", "privateLinkServiceNetworkPolicies": "Enabled", "delegations": [ { "name": "webapp", "properties": { "serviceName": "Microsoft.Web/serverFarms", "actions": [ "Microsoft.Network/virtualNetworks/subnets/action" ] } } ] } }, { "name": "[parameters('privateEndpointSubnetName')]", "properties": { "addressPrefix": "[parameters('privateEndpointSubnetAddressPrefix')]", "privateLinkServiceNetworkPolicies": "Enabled", "privateEndpointNetworkPolicies": "Disabled" } }, { "name": "[parameters('virtualMachineSubnetName')]", "properties": { "addressPrefix": "[parameters('virtualMachineSubnetAddressPrefix')]", "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('vmSubnetNsgName'))]" }, "privateLinkServiceNetworkPolicies": "Enabled", "privateEndpointNetworkPolicies": "Disabled" } }, { "name": "[parameters('bastionSubnetName')]", "properties": { "addressPrefix": "[parameters('bastionSubnetAddressPrefix')]", "privateEndpointNetworkPolicies": "Enabled", "privateLinkServiceNetworkPolicies": "Enabled" } } ] } }, { "type": "Microsoft.DocumentDB/databaseAccounts", "name": "[toLower(parameters('cosmosDbAccountName'))]", "apiVersion": "2020-09-01", "kind": "GlobalDocumentDB", "location": "[parameters('location')]", "properties": { "consistencyPolicy": { "Session": { "defaultConsistencyLevel": "Session" } }, "locations": [ { "locationName": "[parameters('location')]", "failoverPriority": 0, "isZoneRedundant": false } ], "databaseAccountOfferType": "Standard", "publicNetworkAccess": "Disabled" } }, { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", "name": "[variables('cosmosDbDatabaseName')]", "apiVersion": "2020-09-01", "dependsOn": [ "[variables('cosmosDbAccountId')]" ], "properties": { "resource": { "id": "[ parameters('cosmosDbDatabaseName')]" }, "options": { } } }, { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers", "name": "[variables('cosmosDbDatabaseContainerName')]", "apiVersion": "2020-09-01", "dependsOn": [ "[variables('cosmosDbAccountId')]", "[variables('cosmosDbDatabaseId')]" ], "properties": { "resource": { "id": "[parameters('cosmosDbContainerName')]", "partitionKey": { "paths": [ "/id" ], "kind": "Hash" }, "indexingPolicy": { "indexingMode": "consistent", "includedPaths": [ { "path": "/*" } ], "excludedPaths": [ { "path": "/\"_etag\"/?" } ] } }, "options": { "throughput": 400 } } }, { "apiVersion": "2020-06-01", "type": "Microsoft.Compute/virtualMachines", "name": "[parameters('vmName')]", "location": "[parameters('location')]", "dependsOn": [ "[variables('vmDiagnosticStorageAccountId')]", "[variables('vmDiagnosticStorageAccountPrivateEndpointId')]", "[variables('vmNicId')]" ], "properties": { "hardwareProfile": { "vmSize": "[parameters('vmSize')]" }, "osProfile": { "computerName": "[parameters('vmName')]", "adminUsername": "[parameters('adminUsername')]", "adminPassword": "[parameters('adminPasswordOrKey')]" }, "storageProfile": { "imageReference": { "publisher": "[parameters('imagePublisher')]", "offer": "[parameters('imageOffer')]", "sku": "[parameters('imageSku')]", "version": "latest" }, "osDisk": { "name": "[concat(parameters('vmName'),'OSDisk')]", "caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": "[parameters('osDiskSize')]", "managedDisk": { "storageAccountType": "[parameters('diskStorageAccounType')]" } }, "copy": [ { "name": "dataDisks", "count": "[parameters('numDataDisks')]", "input": { "caching": "[parameters('dataDiskCaching')]", "diskSizeGB": "[parameters('dataDiskSize')]", "lun": "[copyIndex('dataDisks')]", "name": "[concat(parameters('vmName'),'-DataDisk',copyIndex('dataDisks'))]", "createOption": "Empty", "managedDisk": { "storageAccountType": "[parameters('diskStorageAccounType')]" } } } ] }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('vmNicName'))]" } ] }, "diagnosticsProfile": { "bootDiagnostics": { "enabled": true, "storageUri": "[reference(variables('vmDiagnosticStorageAccountId')).primaryEndpoints['blob']]" } } } }, { "apiVersion": "2020-06-01", "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(parameters('vmName'), '/MicrosoftMonitoringAgent')]", "location": "[resourceGroup().location]", "dependsOn": [ "[variables('vmId')]", "[variables('workspaceId')]" ], "properties": { "publisher": "Microsoft.EnterpriseCloud.Monitoring", "type": "MicrosoftMonitoringAgent", "typeHandlerVersion": "1.0", "autoUpgradeMinorVersion": true, "settings": { "workspaceId": "[reference(variables('workspaceId'), '2020-08-01').customerId]", "stopOnMultipleConnections": false }, "protectedSettings": { "workspaceKey": "[listKeys(variables('workspaceId'),'2020-08-01').primarySharedKey]" } } }, { "apiVersion": "2020-06-01", "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(parameters('vmName'), '/DependencyAgent')]", "location": "[resourceGroup().location]", "dependsOn": [ "[variables('vmId')]", "[variables('workspaceId')]" ], "properties": { "publisher": "Microsoft.Azure.Monitoring.DependencyAgent", "type": "DependencyAgentWindows", "typeHandlerVersion": "9.4", "autoUpgradeMinorVersion": true } }, { "apiVersion": "2020-08-01", "type": "Microsoft.OperationalInsights/workspaces", "name": "[parameters('workspaceName')]", "location": "[parameters('location')]", "properties": { "sku": { "name": "[parameters('workspaceSku')]" } }, "resources": [ { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskAvgDiskSecTransfer", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Avg. Disk sec/Transfer" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskDiskReadBytesSec", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Disk Read Bytes/sec" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskDiskTransfersSec", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Disk Transfers/sec" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskDiskWritesSec", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Average_Disk Writes/sec" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskFreeMegabytes", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Free Megabytes" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsMemoryAvailableMBytes", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "Memory", "instanceName": "*", "intervalSeconds": 10, "counterName": "Available MBytes Memory" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsMemoryPercentageUsedMemory", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "Memory", "instanceName": "*", "intervalSeconds": 10, "counterName": "Average_% Used Memory" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsNetworkAdapterTotalBytesReceived", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "Network Adapter", "instanceName": "*", "intervalSeconds": 10, "counterName": "Total Bytes Received" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsNetworkAdapterTotalBytesTransmitted", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "Network Adapter", "instanceName": "*", "intervalSeconds": 10, "counterName": "Total Bytes Transmitted" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsNetworkAdapterTotalBytes", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "Network Adapter", "instanceName": "*", "intervalSeconds": 10, "counterName": "Total Bytes" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsProcessorPctProcessorTimeTotal", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "Processor", "instanceName": "_Total", "intervalSeconds": 10, "counterName": "% Processor Time" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskCurrentDiskQueueLength", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Average_Current Disk Queue Length" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsLogicalDiskDiskReadsSec", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "LogicalDisk", "instanceName": "*", "intervalSeconds": 10, "counterName": "Disk Reads/sec" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsASPNETApplicationsRequestsSec", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "ASP.NET Applications", "instanceName": "*", "intervalSeconds": 10, "counterName": "Requests/Sec" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsASPNETApplicationsRequestExecutionTime", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "ASP.NET Applications", "instanceName": "*", "intervalSeconds": 10, "counterName": "Request Execution Time" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsASPNETApplicationsRequestsExecuting", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "ASP.NET Applications", "instanceName": "*", "intervalSeconds": 10, "counterName": "Requests Executing" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsASPNETApplicationsRequestsInApplicationQueue", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "ASP.NET Applications", "instanceName": "*", "intervalSeconds": 10, "counterName": "Requests In Application Queue" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsASPNETApplicationsRequestsTimedOut", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "ASP.NET Applications", "instanceName": "*", "intervalSeconds": 10, "counterName": "Requests Timed Out" } }, { "apiVersion": "2020-08-01", "type": "dataSources", "name": "VMInsightsASPNETApplicationsErrorsTotalSec", "dependsOn": [ "[variables('workspaceId')]" ], "kind": "WindowsPerformanceCounter", "properties": { "objectName": "ASP.NET Applications", "instanceName": "*", "intervalSeconds": 10, "counterName": "Errors Total/Sec" } } ] }, { "type": "Microsoft.Insights/components", "apiVersion": "2020-02-02-preview", "location": "[parameters('location')]", "name": "[parameters('applicationInsightsName')]", "kind": "web", "dependsOn": [ "[variables('workspaceId')]" ], "properties": { "Application_Type": "web", "SamplingPercentage": 100, "DisableIpMasking": true, "WorkspaceResourceId": "[variables('workspaceId')]" } }, { "type": "Microsoft.Network/privateDnsZones", "apiVersion": "2020-06-01", "name": "[variables('storageBlobPrivateDnsZoneName')]", "location": "global", "properties": { "maxNumberOfRecordSets": 25000, "maxNumberOfVirtualNetworkLinks": 1000, "maxNumberOfVirtualNetworkLinksWithRegistration": 100 } }, { "type": "Microsoft.Network/privateDnsZones", "apiVersion": "2020-06-01", "name": "[variables('storageFilePrivateDnsZoneName')]", "location": "global", "properties": { "maxNumberOfRecordSets": 25000, "maxNumberOfVirtualNetworkLinks": 1000, "maxNumberOfVirtualNetworkLinksWithRegistration": 100 } }, { "type": "Microsoft.Network/privateDnsZones", "apiVersion": "2020-06-01", "name": "[variables('storageTablePrivateDnsZoneName')]", "location": "global", "properties": { "maxNumberOfRecordSets": 25000, "maxNumberOfVirtualNetworkLinks": 1000, "maxNumberOfVirtualNetworkLinksWithRegistration": 100 } }, { "type": "Microsoft.Network/privateDnsZones", "apiVersion": "2020-06-01", "name": "[variables('storageQueuePrivateDnsZoneName')]", "location": "global", "properties": { "maxNumberOfRecordSets": 25000, "maxNumberOfVirtualNetworkLinks": 1000, "maxNumberOfVirtualNetworkLinksWithRegistration": 100 } }, { "type": "Microsoft.Network/privateDnsZones", "apiVersion": "2020-06-01", "name": "[variables('cosmosDbPrivateDnsZoneName')]", "location": "global", "properties": { "maxNumberOfRecordSets": 25000, "maxNumberOfVirtualNetworkLinks": 1000, "maxNumberOfVirtualNetworkLinksWithRegistration": 100 } }, { "type": "Microsoft.Network/privateDnsZones", "apiVersion": "2020-06-01", "name": "[variables('serviceBusNamespacePrivateDnsZoneName')]", "location": "global", "properties": { "maxNumberOfRecordSets": 25000, "maxNumberOfVirtualNetworkLinks": 1000, "maxNumberOfVirtualNetworkLinksWithRegistration": 100 } }, { "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", "apiVersion": "2020-06-01", "name": "[concat(variables('storageBlobPrivateDnsZoneName'), '/link_to_', toLower(parameters('virtualNetworkName')))]", "location": "global", "dependsOn": [ "[variables('storageBlobPrivateDnsZoneId')]", "[variables('vnetId')]" ], "properties": { "registrationEnabled": false, "virtualNetwork": { "id": "[variables('vnetId')]" } } }, { "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", "apiVersion": "2020-06-01", "name": "[concat(variables('storageFilePrivateDnsZoneName'), '/link_to_', toLower(parameters('virtualNetworkName')))]", "location": "global", "dependsOn": [ "[variables('storageFilePrivateDnsZoneId')]", "[variables('vnetId')]" ], "properties": { "registrationEnabled": false, "virtualNetwork": { "id": "[variables('vnetId')]" } } }, { "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", "apiVersion": "2020-06-01", "name": "[concat(variables('storageTablePrivateDnsZoneName'), '/link_to_', toLower(parameters('virtualNetworkName')))]", "location": "global", "dependsOn": [ "[variables('storageTablePrivateDnsZoneId')]", "[variables('vnetId')]" ], "properties": { "registrationEnabled": false, "virtualNetwork": { "id": "[variables('vnetId')]" } } }, { "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", "apiVersion": "2020-06-01", "name": "[concat(variables('storageQueuePrivateDnsZoneName'), '/link_to_', toLower(parameters('virtualNetworkName')))]", "location": "global", "dependsOn": [ "[variables('storageQueuePrivateDnsZoneId')]", "[variables('vnetId')]" ], "properties": { "registrationEnabled": false, "virtualNetwork": { "id": "[variables('vnetId')]" } } }, { "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", "apiVersion": "2020-06-01", "name": "[concat(variables('cosmosDbPrivateDnsZoneName'), '/link_to_', toLower(parameters('virtualNetworkName')))]", "location": "global", "dependsOn": [ "[variables('cosmosDbPrivateDnsZoneId')]", "[variables('vnetId')]" ], "properties": { "registrationEnabled": false, "virtualNetwork": { "id": "[variables('vnetId')]" } } }, { "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", "apiVersion": "2020-06-01", "name": "[concat(variables('serviceBusNamespacePrivateDnsZoneName'), '/link_to_', toLower(parameters('virtualNetworkName')))]", "location": "global", "dependsOn": [ "[variables('serviceBusNamespacePrivateDnsZoneId')]", "[variables('vnetId')]" ], "properties": { "registrationEnabled": false, "virtualNetwork": { "id": "[variables('vnetId')]" } } }, { "type": "Microsoft.Network/privateEndpoints", "name": "[parameters('vmDiagnosticStorageAccountPrivateEndpointName')]", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('vmDiagnosticStorageAccountId')]", "[variables('vnetId')]" ], "properties": { "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "privateLinkServiceConnections": [ { "name": "[parameters('vmDiagnosticStorageAccountPrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('vmDiagnosticStorageAccountId')]", "groupIds": [ "blob" ] } } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "BlobPrivateDnsZoneGroup", "dependsOn": [ "[variables('storageBlobPrivateDnsZoneId')]", "[variables('vmDiagnosticStorageAccountPrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfiguration", "properties": { "privateDnsZoneId": "[variables('storageBlobPrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/privateEndpoints", "name": "[parameters('webJobsBlobStorageAccountPrivateEndpointName')]", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('webJobsStorageAccountId')]", "[variables('vnetId')]" ], "properties": { "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "privateLinkServiceConnections": [ { "name": "[parameters('webJobsBlobStorageAccountPrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('webJobsStorageAccountId')]", "groupIds": [ "blob" ] } } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "BlobPrivateDnsZoneGroup", "dependsOn": [ "[variables('storageBlobPrivateDnsZoneId')]", "[variables('webJobsBlobStorageAccountPrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfiguration", "properties": { "privateDnsZoneId": "[variables('storageBlobPrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/privateEndpoints", "name": "[parameters('webJobsFileStorageAccountPrivateEndpointName')]", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('webJobsStorageAccountId')]", "[variables('vnetId')]" ], "properties": { "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "privateLinkServiceConnections": [ { "name": "[parameters('webJobsFileStorageAccountPrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('webJobsStorageAccountId')]", "groupIds": [ "file" ] } } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "FilePrivateDnsZoneGroup", "dependsOn": [ "[variables('storageFilePrivateDnsZoneId')]", "[variables('webJobsFileStorageAccountPrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfiguration", "properties": { "privateDnsZoneId": "[variables('storageFilePrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/privateEndpoints", "name": "[parameters('webJobsTableStorageAccountPrivateEndpointName')]", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('webJobsStorageAccountId')]", "[variables('vnetId')]" ], "properties": { "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "privateLinkServiceConnections": [ { "name": "[parameters('webJobsTableStorageAccountPrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('webJobsStorageAccountId')]", "groupIds": [ "table" ] } } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "TablePrivateDnsZoneGroup", "dependsOn": [ "[variables('storageTablePrivateDnsZoneId')]", "[variables('webJobsTableStorageAccountPrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfiguration", "properties": { "privateDnsZoneId": "[variables('storageTablePrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/privateEndpoints", "name": "[parameters('webJobsQueueStorageAccountPrivateEndpointName')]", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('webJobsStorageAccountId')]", "[variables('vnetId')]" ], "properties": { "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "privateLinkServiceConnections": [ { "name": "[parameters('webJobsQueueStorageAccountPrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('webJobsStorageAccountId')]", "groupIds": [ "queue" ] } } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "QueuePrivateDnsZoneGroup", "dependsOn": [ "[variables('storageQueuePrivateDnsZoneId')]", "[variables('webJobsQueueStorageAccountPrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfiguration", "properties": { "privateDnsZoneId": "[variables('storageQueuePrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/privateEndpoints", "name": "[parameters('cosmosDbPrivateEndpointName')]", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('cosmosDbAccountId')]", "[variables('vnetId')]" ], "properties": { "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "privateLinkServiceConnections": [ { "name": "[parameters('cosmosDbPrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('cosmosDbAccountId')]", "groupIds": [ "Sql" ] } } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "location": "[parameters('location')]", "name": "CosmosDbPrivateDnsZoneGroup", "dependsOn": [ "[variables('cosmosDbPrivateDnsZoneId')]", "[variables('cosmosDbPrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfiguration", "properties": { "privateDnsZoneId": "[variables('cosmosDbPrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/privateEndpoints", "apiVersion": "2020-04-01", "name": "[parameters('serviceBusNamespacePrivateEndpointName')]", "location": "[parameters('location')]", "dependsOn": [ "[variables('vnetId')]", "[variables('serviceBusNamespaceId')]", "[variables('serviceBusNamespacePrivateDnsZoneId')]" ], "properties": { "privateLinkServiceConnections": [ { "name": "[parameters('serviceBusNamespacePrivateEndpointName')]", "properties": { "privateLinkServiceId": "[variables('serviceBusNamespaceId')]", "groupIds": [ "namespace" ] } } ], "subnet": { "id": "[variables('privateEndpointSubnetId')]" }, "customDnsConfigs": [ { "fqdn": "[concat(parameters('serviceBusNamespaceName'), variables('serviceBusPublicDNSZoneForwarder'))]" } ] }, "resources": [ { "type": "privateDnsZoneGroups", "apiVersion": "2020-07-01", "name": "ServiceBusNamespacePrivateDnsZoneGroup", "location": "[parameters('location')]", "dependsOn": [ "[variables('serviceBusNamespacePrivateDnsZoneId')]", "[variables('serviceBusNamespacePrivateEndpointId')]" ], "properties": { "privateDnsZoneConfigs": [ { "name": "dnsConfig", "properties": { "privateDnsZoneId": "[variables('serviceBusNamespacePrivateDnsZoneId')]" } } ] } } ] }, { "type": "Microsoft.Network/bastionHosts", "name": "[parameters('bastionHostName')]", "apiVersion": "2020-05-01", "location": "[parameters('location')]", "dependsOn": [ "[variables('bastionPublicIPAddressId')]", "[variables('vnetId')]" ], "properties": { "ipConfigurations": [ { "name": "IpConfiguration", "properties": { "subnet": { "id": "[variables('bastionSubnetId')]" }, "publicIPAddress": { "id": "[variables('bastionPublicIPAddressId')]" } } } ] }, "resources": [ { "type": "providers/diagnosticSettings", "apiVersion": "2017-05-01-preview", "name": "Microsoft.Insights/default", "location": "[parameters('location')]", "dependsOn": [ "[variables('bastionHostId')]", "[variables('workspaceId')]" ], "properties": { "workspaceId": "[variables('workspaceId')]", "metrics": [], "logs": [ { "category": "BastionAuditLogs", "enabled": true } ] } } ] }, { "type": "Microsoft.Network/networkInterfaces", "apiVersion": "2020-07-01", "name": "[variables('vmNicName')]", "location": "[parameters('location')]", "dependsOn": [ "[variables('vnetId')]" ], "properties": { "ipConfigurations": [ { "name": "ipConfiguration", "properties": { "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "[variables('virtualMachineSubnetId')]" } } } ] } }, { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2020-07-01", "name": "[variables('bastionPublicIPAddressName')]", "location": "[parameters('location')]", "sku": { "name": "Standard" }, "properties": { "publicIPAllocationMethod": "Static", "dnsSettings": { "domainNameLabel": "[variables('dnsLabelPrefix')]" } } }, { "apiVersion": "2020-07-01", "type": "Microsoft.Network/networkSecurityGroups", "name": "[variables('vmSubnetNsgName')]", "location": "[parameters('location')]", "properties": { "securityRules": [ { "name": "Block_RDP_Internet", "properties": { "description": "Block RDP", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "3389", "sourceAddressPrefix": "Internet", "destinationAddressPrefix": "*", "access": "Deny", "priority": 101, "direction": "Inbound" } } ] }, "resources": [ { "type": "providers/diagnosticSettings", "apiVersion": "2017-05-01-preview", "name": "Microsoft.Insights/diagnosticSettings", "location": "[parameters('location')]", "dependsOn": [ "[variables('vmSubnetNsgId')]", "[variables('workspaceId')]" ], "properties": { "workspaceId": "[variables('workspaceId')]", "metrics": [], "logs": [ { "category": "NetworkSecurityGroupEvent", "enabled": true, "retentionPolicy": { "enabled": false, "days": 0 } }, { "category": "NetworkSecurityGroupRuleCounter", "enabled": true, "retentionPolicy": { "enabled": false, "days": 0 } } ] } } ] }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2020-09-01", "name": "[parameters('hostingPlanName')]", "location": "[parameters('location')]", "sku": { "name": "EP1", "tier": "ElasticPremium" }, "kind": "elastic", "properties": { "maximumElasticWorkerCount": 20, "perSiteScaling": true }, "resources": [ { "apiVersion": "2017-05-01-preview", "type": "providers/diagnosticSettings", "name": "Microsoft.Insights/service", "dependsOn": [ "[variables('hostingPlanId')]", "[variables('workspaceId')]" ], "properties": { "mode": "Incremental", "workspaceId": "[variables('workspaceId')]", "logs": [], "metrics": [ { "enabled": true } ] } } ] }, { "type": "Microsoft.Web/sites", "apiVersion": "2020-09-01", "name": "[parameters('functionAppName')]", "location": "[parameters('location')]", "dependsOn": [ "[variables('hostingPlanId')]", "[variables('webJobsStorageAccountId')]", "[variables('functionAppContentStorageAccountId')]", "[variables('vnetId')]" ], "kind": "functionapp", "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]", "siteConfig": { "appSettings": [ { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(variables('applicationInsightsId'), '2018-05-01-preview').instrumentationKey]" }, { "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", "value": "[concat('InstrumentationKey=', reference(variables('applicationInsightsId'), '2018-05-01-preview').instrumentationKey)]" }, { "name": "AzureWebJobsStorage", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('webJobsStorageAccountName'),';AccountKey=',listkeys(variables('webJobsStorageAccountId'), '2019-06-01').keys[0].value,';')]" }, { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~3" }, { "name": "FUNCTIONS_WORKER_RUNTIME", "value": "dotnet" }, { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('functionAppContentStorageAccountName'),';AccountKey=',listkeys(variables('functionAppContentStorageAccountId'), '2019-06-01').keys[0].value,';')]" }, { "name": "WEBSITE_CONTENTSHARE", "value": "[toLower(parameters('hostingPlanName'))]" }, { "name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "~12" }, { "name": "WEBSITE_VNET_ROUTE_ALL", "value": "1" }, { "name": "WEBSITE_DNS_SERVER", "value": "168.63.129.16" }, { "name": "ServiceBusConnectionString", "value": "[listkeys(variables('serviceBusNamespaceAuthRuleResourceId'), '2017-04-01').primaryConnectionString]" }, { "name": "ServiceBusQueueName", "value": "[parameters('serviceBusQueueName')]" }, { "name": "CosmosDbName", "value": "[parameters('cosmosDbDatabaseName')]" }, { "name": "CosmosDbCollectionName", "value": "[parameters('cosmosDbContainerName')]" }, { "name": "CosmosDBConnection", "value": "[listConnectionStrings(variables('cosmosDbAccountId'), '2020-09-01').connectionStrings[0].connectionString]" } ] } }, "resources": [ { "type": "networkConfig", "apiVersion": "2019-08-01", "name": "virtualNetwork", "dependsOn": [ "[variables('functionAppId')]" ], "properties": { "subnetResourceId": "[variables('functionSubnetId')]", "isSwift": true } }, { "type": "config", "name": "web", "apiVersion": "2020-09-01", "dependsOn": [ "[variables('functionAppId')]" ], "properties": { "functionsRuntimeScaleMonitoringEnabled": true } }, { "type": "providers/diagnosticsettings", "name": "Microsoft.Insights/service", "apiVersion": "2017-05-01-preview", "dependsOn": [ "[variables('functionAppId')]", "[variables('workspaceId')]" ], "properties": { "workspaceId": "[variables('workspaceId')]", "logs": [ { "category": "FunctionAppLogs", "enabled": true, "retentionPolicy": { "enabled": true, "days": 0 } } ], "metrics": [ { "category": "AllMetrics", "timeGrain": "PT1M", "enabled": true, "retentionPolicy": { "enabled": false, "days": 0 } } ] } } ] }, { "type": "microsoft.insights/activityLogAlerts", "apiVersion": "2017-04-01", "name": "AllAzureAdvisorAlert", "location": "Global", "properties": { "scopes": [ "[resourceGroup().id]" ], "condition": { "allOf": [ { "field": "category", "equals": "Recommendation" }, { "field": "operationName", "equals": "Microsoft.Advisor/recommendations/available/action" } ] }, "actions": { "actionGroups": [ ] }, "enabled": true, "description": "All azure advisor alerts" } } ], "outputs": { } }