<commit_before>{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "agentBase": {
            "type": "string",
            "defaultValue": "Windows - VS2017 Enterprise (latest)",
            "allowedValues": [
                "Windows - VS2017 Enterprise (latest)"
            ]
        },
        "agentCount": {
            "type": "int",
            "defaultValue": 1,
            "minValue": 1
        },
        "agentSize": {
            "type": "string",
            "defaultValue": "Standard_D2_v3",
            "minLength": 1
        },
        "vstsAccount": {
            "type": "string",
            "minLength": 1
        },
        "vstsPool": {
            "type": "string",
            "minLength": 1
        },
        "vstsPAT": {
            "type": "securestring"
        },
        "adminUsername": {
            "type": "string",
            "metadata": {
                "description": "<NAME>"
            }
        },
        "adminPassword": {
            "type": "securestring",
            "metadata": {
                "description": "<PASSWORD>"
            }
        },
        "_artifactsLocation": {
            "type": "string",
            "metadata": {
                "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
            },
            "defaultValue": "https://raw.githubusercontent.com/markusheiliger/devtestlab-edge/master/environments/VSTS-BuildRig"
        },
        "_artifactsLocationSasToken": {
            "type": "securestring",
            "metadata": {
                "description": "The sasToken required to access _artifactsLocation.  When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
            },
            "defaultValue": ""
        }
    },
    "variables": {
        "resourcePrefix": "[take(concat('br', uniqueString(resourceGroup().id)),10)]",
        "vmName": "[concat(variables('resourcePrefix'), '-ag')]",
        "asName": "[concat(variables('resourcePrefix'), '-as')]",
        "vnetName": "[concat(variables('resourcePrefix'), '-vnet')]",
        "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetName'))]",
        "vnetPrefix": "10.0.0.0/16",
        "snetName": "Rig",
        "snetID": "[concat(variables('vnetID'),'/subnets/', variables('snetName'))]",
        "snetPrefix": "10.0.0.0/24",
        "pipName": "[concat(variables('resourcePrefix'), '-pip')]",
        "pipID": "[resourceId('Microsoft.Network/publicIPAddresses', variables('pipName'))]",
        "nicName": "[concat(variables('resourcePrefix'), '-nic')]",
        "nicID": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]",
        "lbName": "[concat(variables('resourcePrefix'), '-lb')]",
        "lbID": "[resourceId('Microsoft.Network/loadBalancers', variables('lbName'))]",
        "frontEndIPConfigID": "[concat(variables('lbID'),'/frontendIPConfigurations/loadBalancerFrontend')]",
        "agentBaseConfig": "[variables('agentBaseConfigList')[parameters('agentBase')]]",
        "agentBaseConfigList": {
            "Windows - VS2017 Enterprise (latest)": {
                "publisher": "MicrosoftVisualStudio",
                "offer": "VisualStudio",
                "sku": "VS-2017-Ent-Latest-WS2016",
                "version": "latest",
                "scriptFiles": [
                    "[concat(parameters('_artifactsLocation'), '/azuredeploy.windows.ps1', parameters('_artifactsLocationSasToken'))]"
                ],
                "scriptCommand": "[concat('powershell.exe -ExecutionPolicy Unrestricted -Command ./azuredeploy.windows.ps1 -vstsAccount ', parameters('vstsAccount'), ' -personalAccessToken ', parameters('vstsPAT'), ' -PoolName ', parameters('vstsPool'))]"
            }
        }
    },
    "resources": [
        {
            "type": "Microsoft.Compute/availabilitySets",
            "name": "[variables('asName')]",
            "apiVersion": "2016-04-30-preview",
            "location": "[resourceGroup().location]",
            "properties": {
                "platformFaultDomainCount": 2,
                "platformUpdateDomainCount": 2,
                "managed": true
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/publicIPAddresses",
            "name": "[variables('pipName')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "publicIPAllocationMethod": "Dynamic",
                "dnsSettings": {
                    "domainNameLabel": "[variables('resourcePrefix')]"
                }
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/virtualNetworks",
            "name": "[variables('vnetName')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "addressSpace": {
                    "addressPrefixes": [
                        "[variables('vnetPrefix')]"
                    ]
                },
                "subnets": [
                    {
                        "name": "[variables('snetName')]",
                        "properties": {
                            "addressPrefix": "[variables('snetPrefix')]"
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[concat(variables('nicName'), copyindex())]",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "nicLoop",
                "count": "[parameters('agentCount')]"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/virtualNetworks/', variables('vnetName'))]",
                "[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]",
                "[concat('Microsoft.Network/loadBalancers/', variables('lbName'), '/inboundNatRules/', 'RDP-VM', copyIndex())]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig1",
                        "properties": {
                            "privateIPAllocationMethod": "Dynamic",
                            "subnet": {
                                "id": "[variables('snetID')]"
                            },
                            "loadBalancerBackendAddressPools": [
                                {
                                    "id": "[concat(variables('lbID'), '/backendAddressPools/LoadBalancerBackend')]"
                                }
                            ],
                            "loadBalancerInboundNatRules": [
                                {
                                    "id": "[concat(variables('lbID'),'/inboundNatRules/RDP-VM', copyindex())]"
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2015-06-15",
            "name": "[variables('lbName')]",
            "type": "Microsoft.Network/loadBalancers",
            "location": "[resourceGroup().location]",
            "dependsOn": [
                "[concat('Microsoft.Network/publicIPAddresses/', variables('pipName'))]"
            ],
            "properties": {
                "frontendIPConfigurations": [
                    {
                        "name": "LoadBalancerFrontend",
                        "properties": {
                            "publicIPAddress": {
                                "id": "[variables('pipID')]"
                            }
                        }
                    }
                ],
                "backendAddressPools": [
                    {
                        "name": "LoadBalancerBackend"
                    }
                ]
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/loadBalancers/inboundNatRules",
            "name": "[concat(variables('lbName'), '/', 'RDP-VM', copyIndex())]",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "lbNatLoop",
                "count": "[parameters('agentCount')]"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]"
            ],
            "properties": {
                "frontendIPConfiguration": {
                    "id": "[variables('frontEndIPConfigID')]"
                },
                "protocol": "tcp",
                "frontendPort": "[copyIndex(5000)]",
                "backendPort": 3389,
                "enableFloatingIP": false
            }
        },
        {
            "apiVersion": "2016-04-30-preview",
            "type": "Microsoft.Compute/virtualMachines",
            "name": "[concat(variables('vmName'), copyindex())]",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "virtualMachineLoop",
                "count": "[parameters('agentCount')]"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex())]",
                "[concat('Microsoft.Compute/availabilitySets/', variables('asName'))]"
            ],
            "properties": {
                "availabilitySet": {
                    "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('asName'))]"
                },
                "hardwareProfile": {
                    "vmSize": "[parameters('agentSize')]"
                },
                "osProfile": {
                    "computerName": "[concat(variables('vmName'), copyIndex())]",
                    "adminUsername": "[parameters('adminUsername')]",
                    "adminPassword": "[parameters('adminPassword')]"
                },
                "storageProfile": {
                    "imageReference": {<commit_msg>track artificatslocation for each vm<commit_after>{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "agentBase": {
            "type": "string",
            "defaultValue": "Windows - VS2017 Enterprise (latest)",
            "allowedValues": [
                "Windows - VS2017 Enterprise (latest)"
            ]
        },
        "agentCount": {
            "type": "int",
            "defaultValue": 1,
            "minValue": 1
        },
        "agentSize": {
            "type": "string",
            "defaultValue": "Standard_D2_v3",
            "minLength": 1
        },
        "vstsAccount": {
            "type": "string",
            "minLength": 1
        },
        "vstsPool": {
            "type": "string",
            "minLength": 1
        },
        "vstsPAT": {
            "type": "securestring"
        },
        "adminUsername": {
            "type": "string",
            "metadata": {
                "description": "Admin username"
            }
        },
        "adminPassword": {
            "type": "securestring",
            "metadata": {
                "description": "Admin password"
            }
        },
        "_artifactsLocation": {
            "type": "string",
            "metadata": {
                "description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
            },
            "defaultValue": "https://raw.githubusercontent.com/markusheiliger/devtestlab-edge/master/environments/VSTS-BuildRig"
        },
        "_artifactsLocationSasToken": {
            "type": "securestring",
            "metadata": {
                "description": "The sasToken required to access _artifactsLocation.  When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
            },
            "defaultValue": ""
        }
    },
    "variables": {
        "resourcePrefix": "[take(concat('br', uniqueString(resourceGroup().id)),10)]",
        "vmName": "[concat(variables('resourcePrefix'), '-ag')]",
        "asName": "[concat(variables('resourcePrefix'), '-as')]",
        "vnetName": "[concat(variables('resourcePrefix'), '-vnet')]",
        "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetName'))]",
        "vnetPrefix": "10.0.0.0/16",
        "snetName": "Rig",
        "snetID": "[concat(variables('vnetID'),'/subnets/', variables('snetName'))]",
        "snetPrefix": "10.0.0.0/24",
        "pipName": "[concat(variables('resourcePrefix'), '-pip')]",
        "pipID": "[resourceId('Microsoft.Network/publicIPAddresses', variables('pipName'))]",
        "nicName": "[concat(variables('resourcePrefix'), '-nic')]",
        "nicID": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]",
        "lbName": "[concat(variables('resourcePrefix'), '-lb')]",
        "lbID": "[resourceId('Microsoft.Network/loadBalancers', variables('lbName'))]",
        "frontEndIPConfigID": "[concat(variables('lbID'),'/frontendIPConfigurations/loadBalancerFrontend')]",
        "agentBaseConfig": "[variables('agentBaseConfigList')[parameters('agentBase')]]",
        "agentBaseConfigList": {
            "Windows - VS2017 Enterprise (latest)": {
                "publisher": "MicrosoftVisualStudio",
                "offer": "VisualStudio",
                "sku": "VS-2017-Ent-Latest-WS2016",
                "version": "latest",
                "scriptFiles": [
                    "[concat(parameters('_artifactsLocation'), '/azuredeploy.windows.ps1', parameters('_artifactsLocationSasToken'))]"
                ],
                "scriptCommand": "[concat('powershell.exe -ExecutionPolicy Unrestricted -Command ./azuredeploy.windows.ps1 -vstsAccount ', parameters('vstsAccount'), ' -personalAccessToken ', parameters('vstsPAT'), ' -PoolName ', parameters('vstsPool'))]"
            }
        }
    },
    "resources": [
        {
            "type": "Microsoft.Compute/availabilitySets",
            "name": "[variables('asName')]",
            "apiVersion": "2016-04-30-preview",
            "location": "[resourceGroup().location]",
            "properties": {
                "platformFaultDomainCount": 2,
                "platformUpdateDomainCount": 2,
                "managed": true
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/publicIPAddresses",
            "name": "[variables('pipName')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "publicIPAllocationMethod": "Dynamic",
                "dnsSettings": {
                    "domainNameLabel": "[variables('resourcePrefix')]"
                }
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/virtualNetworks",
            "name": "[variables('vnetName')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "addressSpace": {
                    "addressPrefixes": [
                        "[variables('vnetPrefix')]"
                    ]
                },
                "subnets": [
                    {
                        "name": "[variables('snetName')]",
                        "properties": {
                            "addressPrefix": "[variables('snetPrefix')]"
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[concat(variables('nicName'), copyindex())]",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "nicLoop",
                "count": "[parameters('agentCount')]"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/virtualNetworks/', variables('vnetName'))]",
                "[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]",
                "[concat('Microsoft.Network/loadBalancers/', variables('lbName'), '/inboundNatRules/', 'RDP-VM', copyIndex())]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig1",
                        "properties": {
                            "privateIPAllocationMethod": "Dynamic",
                            "subnet": {
                                "id": "[variables('snetID')]"
                            },
                            "loadBalancerBackendAddressPools": [
                                {
                                    "id": "[concat(variables('lbID'), '/backendAddressPools/LoadBalancerBackend')]"
                                }
                            ],
                            "loadBalancerInboundNatRules": [
                                {
                                    "id": "[concat(variables('lbID'),'/inboundNatRules/RDP-VM', copyindex())]"
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2015-06-15",
            "name": "[variables('lbName')]",
            "type": "Microsoft.Network/loadBalancers",
            "location": "[resourceGroup().location]",
            "dependsOn": [
                "[concat('Microsoft.Network/publicIPAddresses/', variables('pipName'))]"
            ],
            "properties": {
                "frontendIPConfigurations": [
                    {
                        "name": "LoadBalancerFrontend",
                        "properties": {
                            "publicIPAddress": {
                                "id": "[variables('pipID')]"
                            }
                        }
                    }
                ],
                "backendAddressPools": [
                    {
                        "name": "LoadBalancerBackend"
                    }
                ]
            }
        },
        {
            "apiVersion": "2015-06-15",
            "type": "Microsoft.Network/loadBalancers/inboundNatRules",
            "name": "[concat(variables('lbName'), '/', 'RDP-VM', copyIndex())]",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "lbNatLoop",
                "count": "[parameters('agentCount')]"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/loadBalancers/', variables('lbName'))]"
            ],
            "properties": {
                "frontendIPConfiguration": {
                    "id": "[variables('frontEndIPConfigID')]"
                },
                "protocol": "tcp",
                "frontendPort": "[copyIndex(5000)]",
                "backendPort": 3389,
                "enableFloatingIP": false
            }
        },
        {
            "apiVersion": "2016-04-30-preview",
            "type": "Microsoft.Compute/virtualMachines",
            "name": "[concat(variables('vmName'), copyindex())]",
            "location": "[resourceGroup().location]",
            "tags": {
                "_artifactsLocation": "[parameters('_artifactsLocation')]"
            },
            "copy": {
                "name": "virtualMachineLoop",
                "count": "[parameters('agentCount')]"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex())]",
                "[concat('Microsoft.Compute/availabilitySets/', variables('asName'))]"
            ],
            "properties": {
                "availabilitySet": {
                    "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('asName'))]"
                },
                "hardwareProfile": {
                    "vmSize": "[parameters('agentSize')]"
                },
                "osProfile": {
                    "computerName": "[concat(variables('vmName'), copyIndex())]",
                    "adminUsername": "[parameters('adminUsername')]",
                    "adminPassword": "[parameters('adminPassword')]"
                },
                "storageProfile": {
                    "imageReference": {
{'fraction_non_alphanumeric': 0.15553858635994847, 'fraction_numerical': 0.011836013935951892, 'mean_word_length': 1.4791765262659726, 'pattern_counts': {'":': 324, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2129219', 'n_tokens_mistral': 5434, 'n_tokens_neox': 5004, 'n_words': 777}