{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "saName": { "type": "string", "defaultValue": "sabwaf", "metadata": { "description": "The name of your Storage Account." } }, "saKey": { "type": "string", "defaultValue": "changeme", "metadata": { "description": "The name of your SA Key." } }, "saContainer": { "type": "string", "defaultValue": "contbwaf3", "metadata": { "description": "The name of your Container. The blob name is hardcoded in the bwaf code to be barracuda-byol-license-list.jsons." } }, "vmName": { "type": "string", "defaultValue": "sko2020BWAF", "metadata": { "description": "The name of your Virtual Machine." } }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location for all resources." } }, "virtualNetworkName": { "type": "string", "defaultValue": "vnetBWAF", "metadata": { "description": "Name of the VNET" } }, "subnetName": { "type": "string", "defaultValue": "Subnet", "metadata": { "description": "Name of the subnet in the virtual network" } }, "networkSecurityGroupName": { "type": "string", "defaultValue": "secgroupBWAF", "metadata": { "description": "Name of the Network Security Group" } } }, "variables": { "publicIpAddressName": "[concat(parameters('vmName'), 'PublicIP' )]", "networkInterfaceName": "[concat(parameters('vmName'),'NetInt')]", "subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('subnetName'))]", "osDiskType": "Standard_LRS", "subnetAddressPrefix": "10.1.0.0/24", "addressPrefix": "10.1.0.0/16", "userData": { "vmss_instance": 1, "license_storage_account": "[parameters('saName')]", "license_storage_account_key": "[parameters('saKey')]", "license_container_name": "[parameters('saContainer')]", "default_domain": "escapefromthe.net", "signature": "brett", "email": "bwolmarans@barracuda.com", "organization": "cudacudacuda" }, "customData": "[string(variables('userData'))]" }, "resources": [{ "type": "Microsoft.Network/networkInterfaces", "apiVersion": "2018-10-01", "name": "[variables('networkInterfaceName')]", "location": "[parameters('location')]", "dependsOn": [ "[resourceId('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]", "[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]", "[resourceId('Microsoft.Network/publicIpAddresses/', variables('publicIpAddressName'))]" ], "properties": { "ipConfigurations": [{ "name": "ipconfig1", "properties": { "subnet": { "id": "[variables('subnetRef')]" }, "privateIPAllocationMethod": "Dynamic", "publicIpAddress": { "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" } } }], "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups',parameters('networkSecurityGroupName'))]" } } }, { "type": "Microsoft.Network/networkSecurityGroups", "apiVersion": "2019-02-01", "name": "[parameters('networkSecurityGroupName')]", "location": "[parameters('location')]", "properties": { "securityRules": [ { "name": "S8K", "properties": { "priority": 1000, "protocol": "TCP", "access": "Allow", "direction": "Inbound", "sourceAddressPrefix": "*", "sourcePortRange": "*", "destinationAddressPrefix": "*", "destinationPortRange": "8443" } }, { "name": "8K", "properties": { "priority": 1010, "protocol": "TCP", "access": "Allow", "direction": "Inbound", "sourceAddressPrefix": "*", "sourcePortRange": "*", "destinationAddressPrefix": "*", "destinationPortRange": "8000" } }, { "name": "eighty", "properties": { "priority": 1020, "protocol": "TCP", "access": "Allow", "direction": "Inbound", "sourceAddressPrefix": "*", "sourcePortRange": "*", "destinationAddressPrefix": "*", "destinationPortRange": "80" } }, { "name": "SSL", "properties": { "priority": 1030, "protocol": "TCP", "access": "Allow", "direction": "Inbound", "sourceAddressPrefix": "*", "sourcePortRange": "*", "destinationAddressPrefix": "*", "destinationPortRange": "443" } } ] } }, { "type": "Microsoft.Network/virtualNetworks", "apiVersion": "2019-04-01", "name": "[parameters('virtualNetworkName')]", "location": "[parameters('location')]", "properties": { "addressSpace": { "addressPrefixes": [ "[variables('addressPrefix')]" ] }, "subnets": [{ "name": "[parameters('subnetName')]", "properties": { "addressPrefix": "[variables('subnetAddressPrefix')]", "privateEndpointNetworkPolicies": "Enabled", "privateLinkServiceNetworkPolicies": "Enabled" } }] } }, { "type": "Microsoft.Network/publicIpAddresses", "apiVersion": "2019-02-01", "name": "[variables('publicIpAddressName')]", "location": "[parameters('location')]", "properties": { "publicIpAllocationMethod": "Dynamic", "publicIPAddressVersion": "IPv4", "dnsSettings": { "domainNameLabel": "bwaf-sko2020" }, "idleTimeoutInMinutes": 4 }, "sku": { "name": "Basic", "tier": "Regional" } }, { "type": "Microsoft.Compute/virtualMachines", "apiVersion": "2019-03-01", "name": "[parameters('vmName')]", "location": "[parameters('location')]", "plan": { "publisher": "barracudanetworks", "name": "byol", "product": "waf" }, "dependsOn": [ "[resourceId('Microsoft.Network/networkInterfaces/', variables('networkInterfaceName'))]" ], "properties": { "hardwareProfile": { "vmSize": "Standard_DS1_v2" }, "storageProfile": { "osDisk": { "createOption": "fromImage", "managedDisk": { "storageAccountType": "Standard_LRS" } }, "imageReference": { "publisher": "barracudanetworks", "offer": "waf", "sku": "byol", "version": "latest" } }, "networkProfile": { "networkInterfaces": [{ "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" }] }, "osProfile": { "computerName": "[parameters('vmName')]", "adminUsername": "not_used", "adminPassword": "Hello123456!", "customData": "[base64(variables('customData'))]" } } } ], "outputs": { "hostname": { "type": "string", "value": "[reference(variables('publicIPAddressName')).dnsSettings.fqdn]" } } }