{ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", "contentVersion": "1.0.0.0", "parameters": { "templateBaseUrl": { "defaultValue": "https://cdn.f5.com/product/cloudsolutions/", "metadata": { "description": "The publicly accessible URL where the linked ARM templates are located." }, "type": "string" }, "artifactLocation": { "defaultValue": "[concat('f5-azure-arm-templates/v', deployment().properties.template.contentVersion, '/examples/')]", "metadata": { "description": "The directory, relative to the templateBaseUrl, where the modules folder is located." }, "type": "string" }, "uniqueString": { "defaultValue": "", "metadata": { "description": "A prefix that will be used to name template resources. Because some resources require globally unique names, we recommend using a unique value." }, "type": "string" }, "sshKey": { "metadata": { "description": "Supply the public key that will be used for SSH authentication to the BIG-IP and application virtual machines." }, "type": "string" }, "newPassword": { "defaultValue": "", "metadata": { "description": "The new password to be used for the admin user on the BIG-IP instances. This is required for creating the AZURE_PASSWORD secret referenced in the runtimeConfig template parameter." }, "type": "securestring" }, "appContainer": { "defaultValue": "f5devcentral/f5-demo-app:1.0.1", "metadata": { "description": "The docker container to use when deploying the example application." }, "type": "string" }, "restrictedSrcMgmtAddress": { "defaultValue": "", "metadata": { "description": "When creating management security group, this field restricts management access to a specific network or address. Enter an IP address or address range in CIDR notation, or asterisk for all sources." }, "type": "string" }, "runtimeConfig": { "defaultValue": "https://github.com/F5Networks/f5-azure-arm-templates-v2/blob/master/examples/autoscale/bigip-configurations/runtime-init-conf-payg.yaml", "metadata": { "description": "Supply a URL to the bigip-runtime-init configuration file in YAML or JSON format, or an escaped JSON string to use for f5-bigip-runtime-init configuration." }, "type": "string" }, "useAvailabilityZones": { "defaultValue": true, "metadata": { "description": "This deployment can deploy resources into Azure Availability Zones (if the region supports it). If that is not desired the input should be set 'No'. If the region does not support availability zones the input should be set to No." }, "type": "bool" }, "tagValues": { "defaultValue": { "application": "APP", "cost": "COST", "environment": "ENV", "group": "GROUP", "owner": "OWNER" }, "metadata": { "description": "Default key/value resource tags will be added to the resources in this deployment, if you would like the values to be unique adjust them as needed for each key." }, "type": "object" } }, "variables": { "deploymentApiVersion": "2019-05-10", "contentVersion": "[deployment().properties.template.contentVersion]", "uniqueString": "[toLower(parameters('uniqueString'))]", "adminUsername": "azureuser", "assignManagedIdentity": "[or(not(empty(parameters('newPassword'))), not(empty(variables('customAutoscaleRules'))))]", "builtInRoleType": "Contributor", "customRoleAssignableScopes": [], "customRoleDescription": "", "customRoleName": "", "customRolePermissions": [], "keyVaultName": "[concat(variables('uniqueString'), 'sv')]", "keyVaultPermissionsKeys": ["get","list"], "keyVaultPermissionsSecrets": ["get","list"], "secretName": "mySecret", "userAssignedIdentityName": "[concat(variables('uniqueString'), '-secretIdentity')]", "appNsg": "[variables('uniqueString')]", "mgmtNsg": "[variables('uniqueString')]", "numSubnets": 2, "provisionPublicIPNetwork": true, "restrictedSrcMgmtPort": "8443", "virtualNetworkName": "[concat(variables('uniqueString'), '-vnet')]", "vnetAddressPrefix": "10.0", "externalLoadBalancerName": "[concat(variables('uniqueString'), '-alb')]", "internalLoadBalancerName": "None", "internalLoadBalancerProbePort": "3456", "internalSubnetId": "", "loadBalancerRulePorts": ["80","443"], "numberPublicAppIPAddresses": 1, "numberPublicMgmtIPAddresses": 0, "provisionApp": "[not(empty(parameters('appContainer')))]", "appInstanceName": "appvm01", "appInstanceType": "Standard_D2s_v3", "cloudInitDeliveryLocation": "", "appInsights": "[concat(variables('uniqueString'), '-insights')]", "appInsightsId": "[resourceId('Microsoft.Insights/components', variables('appInsights'))]", "cpuMetricName": "Percentage CPU", "customAutoscaleRules": [{"scaleAction":{"direction":"Increase","type":"ChangeCount","value":"1","cooldown":"PT1M"},"metricTrigger":{"metricName":"customMetrics/F5_system_cpu","metricNamespace":"","metricResourceUri":"[variables('appInsightsId')]","operator":"GreaterThan","statistic":"Average","threshold":"80","timeAggregation":"Average","timeGrain":"PT1M","timeWindow":"PT10M"}},{"scaleAction":{"direction":"Decrease","type":"ChangeCount","value":"1","cooldown":"PT1M"},"metricTrigger":{"metricName":"customMetrics/F5_system_cpu","metricNamespace":"","metricResourceUri":"[variables('appInsightsId')]","operator":"LessThan","statistic":"Average","threshold":"20","timeAggregation":"Average","timeGrain":"PT1M","timeWindow":"PT10M"}},{"scaleAction":{"direction":"Increase","type":"ChangeCount","value":"1","cooldown":"PT1M"},"metricTrigger":{"metricName":"customMetrics/F5_system_networkInterfaces_mgmt_counters.bitsIn","metricNamespace":"","metricResourceUri":"[variables('appInsightsId')]","operator":"GreaterThan","statistic":"Average","threshold":"20000000","timeAggregation":"Average","timeGrain":"PT1M","timeWindow":"PT10M"}},{"scaleAction":{"direction":"Decrease","type":"ChangeCount","value":"1","cooldown":"PT1M"},"metricTrigger":{"metricName":"customMetrics/F5_system_networkInterfaces_mgmt_counters.bitsIn","metricNamespace":"","metricResourceUri":"[variables('appInsightsId')]","operator":"LessThan","statistic":"Average","threshold":"10000000","timeAggregation":"Average","timeGrain":"PT1M","timeWindow":"PT10M"}}], "customEmail": [], "image": "f5-networks:f5-big-ip-best:f5-bigip-virtual-edition-25m-best-hourly:15.1.004000", "instanceType": "Standard_DS3_v2", "provisionPublicIPBigip": { "name": "publicIp01", "properties": { "idleTimeoutInMinutes": 15 } }, "roleDefinitionId": "", "scaleInCpuThreshold": 20, "scaleInThroughputThreshold": 10000000, "scaleInTimeWindow": 10, "scaleOutCpuThreshold": 80, "scaleOutThroughputThreshold": 20000000, "scaleOutTimeWindow": 10, "throughputMetricName": "Network In", "vmScaleSetMaxCount": 4, "vmScaleSetMinCount": 2, "vmssName": "[concat(variables('uniqueString'), '-vmss')]" }, "resources": [ { "type": "Microsoft.Resources/deployments", "apiVersion": "[variables('deploymentApiVersion')]", "condition": "[variables('assignManagedIdentity')]", "name": "accessTemplate", "properties": { "mode": "Incremental", "templateLink": { "uri": "[concat(parameters('templateBaseUrl'), parameters('artifactLocation'), 'modules/access/access.json')]", "contentVersion": "[variables('contentVersion')]" }, "parameters": { "builtInRoleType":{ "value": "[variables('builtInRoleType')]" }, "customRoleAssignableScopes":{ "value": "[variables('customRoleAssignableScopes')]" }, "customRoleDescription":{ "value": "[variables('customRoleDescription')]" }, "customRoleName":{ "value": "[variables('customRoleName')]" }, "customRolePermissions":{ "value": "[variables('customRolePermissions')]" }, "keyVaultName":{ "value": "[variables('keyVaultName')]" }, "keyVaultPermissionsKeys":{ "value": "[variables('keyVaultPermissionsKeys')]" }, "keyVaultPermissionsSecrets":{ "value": "[variables('keyVaultPermissionsSecrets')]" }, "secretName":{ "value": "[variables('secretName')]" }, "secretValue":{ "value": "[parameters('newPassword')]" }, "userAssignedIdentityName":{ "value": "[variables('userAssignedIdentityName')]" }, "tagValues":{ "value": "[parameters('tagValues')]" } } } }, { "type": "Microsoft.Resources/deployments", "apiVersion": "[variables('deploymentApiVersion')]", "name": "networkTemplate", "properties": { "mode": "Incremental", "templateLink": { "uri": "[concat(parameters('templateBaseUrl'), parameters('artifactLocation'), 'modules/network/network.json')]", "contentVersion": "[variables('contentVersion')]" }, "parameters": { "appNsg":{ "value": "[variables('appNsg')]" }, "mgmtNsg":{ "value": "[variables('mgmtNsg')]" }, "numSubnets":{ "value": "[variables('numSubnets')]" }, "provisionPublicIP":{ "value": "[variables('provisionPublicIPNetwork')]" }, "restrictedSrcMgmtAddress":{ "value": "[parameters('restrictedSrcMgmtAddress')]" }, "restrictedSrcMgmtPort":{ "value": "[variables('restrictedSrcMgmtPort')]" }, "virtualNetworkName":{ "value": "[variables('virtualNetworkName')]" }, "vnetAddressPrefix":{ "value": "[variables('vnetAddressPrefix')]" }, "tagValues":{ "value": "[parameters('tagValues')]" } } } }, { "type": "Microsoft.Resources/deployments", "apiVersion": "[variables('deploymentApiVersion')]", "name": "dagTemplate", "dependsOn": [ "networkTemplate" ], "properties": { "mode": "Incremental", "templateLink": { "uri": "[concat(parameters('templateBaseUrl'), parameters('artifactLocation'), 'modules/dag/dag.json')]", "contentVersion": "[variables('contentVersion')]" }, "parameters": { "dnsLabel":{ "value": "[variables('uniqueString')]" }, "externalLoadBalancerName":{ "value": "[variables('externalLoadBalancerName')]" }, "internalLoadBalancerName":{ "value": "[variables('internalLoadBalancerName')]" }, "internalLoadBalancerProbePort":{ "value": "[variables('internalLoadBalancerProbePort')]" }, "internalSubnetId":{ "value": "[variables('internalSubnetId')]" }, "loadBalancerRulePorts":{ "value": "[variables('loadBalancerRulePorts')]" }, "numberPublicAppIPAddresses":{ "value": "[variables('numberPublicAppIPAddresses')]" }, "numberPublicMgmtIPAddresses":{ "value": "[variables('numberPublicMgmtIPAddresses')]" }, "tagValues":{ "value": "[parameters('tagValues')]" } } } }, { "type": "Microsoft.Resources/deployments", "condition": "[variables('provisionApp')]", "apiVersion": "[variables('deploymentApiVersion')]", "name": "appTemplate", "dependsOn": [ "networkTemplate" ], "properties": { "mode": "Incremental", "templateLink": { "uri": "[concat(parameters('templateBaseUrl'), parameters('artifactLocation'), 'modules/application/application.json')]", "contentVersion": "[variables('contentVersion')]" }, "parameters": { "adminUsername":{ "value": "[variables('adminUsername')]" }, "sshKey":{ "value": "[parameters('sshKey')]" }, "instanceName":{ "value": "[variables('appInstanceName')]" }, "instanceType":{ "value": "[variables('appInstanceType')]" }, "subnetId":{ "value": "[reference('networkTemplate').outputs.appSubnet.value]" }, "nsgId":{ "value": "[reference('networkTemplate').outputs.appNSG.value]" }, "appContainer":{ "value": "[parameters('appContainer')]" }, "cloudInitDeliveryLocation":{ "value": "[variables('cloudInitDeliveryLocation')]" }, "tagValues":{ "value": "[parameters('tagValues')]" } } } }, { "type": "Microsoft.Resources/deployments", "apiVersion": "[variables('deploymentApiVersion')]", "name": "bigipTemplate", "dependsOn": [ "accessTemplate", "networkTemplate", "dagTemplate" ], "properties": { "mode": "Incremental", "templateLink": { "uri": "[concat(parameters('templateBaseUrl'), parameters('artifactLocation'), 'modules/bigip-autoscale/bigip.json')]", "contentVersion": "[variables('contentVersion')]" }, "parameters": { "adminUsername":{ "value": "[variables('adminUsername')]" }, "appInsights":{ "value": "[variables('appInsights')]" }, "cpuMetricName":{ "value": "[variables('cpuMetricName')]" }, "customAutoscaleRules":{ "value": "[variables('customAutoscaleRules')]" }, "customEmail":{ "value": "[variables('customEmail')]" }, "dnsLabel":{ "value": "[variables('uniqueString')]" }, "image":{ "value": "[variables('image')]" }, "inboundMgmtNatPoolID":{ "value": "[if(greater(variables('numberPublicMgmtIPAddresses'), 0), reference('dagTemplate').outputs.inboundMgmtNatPool.value, '')]" }, "inboundSshNatPoolID":{ "value": "[if(greater(variables('numberPublicMgmtIPAddresses'), 0), reference('dagTemplate').outputs.inboundSshNatPool.value, '')]" }, "instanceHealthProbeID":{ "value": "[reference('dagTemplate').outputs.externalLoadBalancerProbesID.value[0]]" }, "instanceType":{ "value": "[variables('instanceType')]" }, "loadBalancerBackendAddressPoolsArray":{ "value": [{ "id": "[reference('dagTemplate').outputs.externalBackEndLoadBalancerID.value]" }] }, "nsgID":{ "value": "[reference('networkTemplate').outputs.mgmtNSG.value]" }, "provisionPublicIP":{ "value": "[variables('provisionPublicIPBigip')]" }, "roleDefinitionId":{ "value": "[variables('roleDefinitionId')]" }, "runtimeConfig":{ "value": "[parameters('runtimeConfig')]" }, "scaleInCpuThreshold":{ "value": "[variables('scaleInCpuThreshold')]" }, "scaleInThroughputThreshold":{ "value": "[variables('scaleInThroughputThreshold')]" }, "scaleInTimeWindow":{ "value": "[variables('scaleInTimeWindow')]" }, "scaleOutCpuThreshold":{ "value": "[variables('scaleOutCpuThreshold')]" }, "scaleOutThroughputThreshold":{ "value": "[variables('scaleOutThroughputThreshold')]" }, "scaleOutTimeWindow":{ "value": "[variables('scaleOutTimeWindow')]" }, "sshKey":{ "value": "[parameters('sshKey')]" }, "subnetId":{ "value": "[reference('networkTemplate').outputs.mgmtSubnet.value]" }, "tagValues":{ "value": "[parameters('tagValues')]" }, "throughputMetricName":{ "value": "[variables('throughputMetricName')]" }, "useAvailabilityZones":{ "value": "[parameters('useAvailabilityZones')]" }, "userAssignManagedIdentity":{ "value": "[if(variables('assignManagedIdentity'), reference('accessTemplate').outputs.userAssignedIdentityId.value, '')]" }, "vmScaleSetMaxCount":{ "value": "[variables('vmScaleSetMaxCount')]" }, "vmScaleSetMinCount":{ "value": "[variables('vmScaleSetMinCount')]" }, "vmssName":{ "value": "[variables('vmssName')]" } } } } ], "outputs": { "virtualNetworkId": { "type": "String", "value": "[reference('networkTemplate').outputs.virtualNetwork.value]" }, "appVmName": { "condition": "[variables('provisionApp')]", "type": "String", "value": "[variables('appInstanceName')]" }, "appPublicIps": { "condition": "[variables('provisionApp')]", "type": "array", "value": "[reference('dagTemplate').outputs.appIps.value]" }, "appPrivateIp": { "condition": "[variables('provisionApp')]", "type": "String", "value": "[reference('appTemplate').outputs.appIp.value]" }, "appUsername": { "condition": "[variables('provisionApp')]", "type": "String", "value": "[variables('adminUsername')]" }, "vmssId": { "type": "String", "value": "[reference('bigipTemplate').outputs.vmssID.value]" }, "bigipUsername": { "type": "String", "value": "[variables('adminUsername')]" }, "bigipPassword": { "condition": "[not(empty(parameters('newPassword')))]", "type": "String", "value": "[parameters('newPassword')]" } } }