Created
September 8, 2017 23:07
-
-
Save dharmeshkakadia/3a709da225e44055cb4e5039a2c02d26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "newStorageAccountName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the new storage account created to store the VMs disks" | |
| } | |
| }, | |
| "storageAccountType": { | |
| "type": "string", | |
| "allowedValues": [ | |
| "Standard_LRS", | |
| "Standard_GRS", | |
| "Standard_RAGRS", | |
| "Premium_LRS" | |
| ], | |
| "metadata": { | |
| "description": "The type of the Storage Account created" | |
| }, | |
| "defaultValue": "Standard_LRS" | |
| }, | |
| "virtualNetworkName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the Virtual Network to Create" | |
| }, | |
| "defaultValue": "adVNET" | |
| }, | |
| "virtualNetworkAddressRange": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The address range of the new VNET in CIDR format" | |
| }, | |
| "defaultValue": "10.0.0.0/16" | |
| }, | |
| "adSubnetName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the subnet created in the new VNET" | |
| }, | |
| "defaultValue": "adSubnet" | |
| }, | |
| "adSubnet": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The address range of the subnet created in the new VNET" | |
| }, | |
| "defaultValue": "10.0.0.0/24" | |
| }, | |
| "dnsServerZone": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The address range of the subnet created in the new VNET" | |
| }, | |
| "defaultValue": "10.in-addr.arpa" | |
| }, | |
| "adPDCNicName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the NIC attached to the new PDC" | |
| }, | |
| "defaultValue": "adPDCNic" | |
| }, | |
| "adPDCNicIPAddress": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The IP address of the new AD PDC" | |
| }, | |
| "defaultValue": "10.0.0.4" | |
| }, | |
| "adBDCNicName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the NIC attached to the new BDC" | |
| }, | |
| "defaultValue": "adBDCNic" | |
| }, | |
| "adBDCNicIPAddress": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The IP address of the new AD BDC" | |
| }, | |
| "defaultValue": "10.0.0.5" | |
| }, | |
| "publicIPAddressName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the public IP address used by the Load Balancer" | |
| }, | |
| "defaultValue": "adpublicIP" | |
| }, | |
| "publicIPAddressType": { | |
| "type": "string", | |
| "allowedValues": [ | |
| "Dynamic", | |
| "Static" | |
| ], | |
| "metadata": { | |
| "description": "The type of the public IP address used by the Load Balancer" | |
| }, | |
| "defaultValue": "Dynamic" | |
| }, | |
| "adPDCVMName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The computer name of the PDC" | |
| }, | |
| "defaultValue": "adPDC" | |
| }, | |
| "adBDCVMName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The computer name of the BDC" | |
| }, | |
| "defaultValue": "adBDC" | |
| }, | |
| "adminUsername": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the Administrator of the new VM and Domain" | |
| }, | |
| "defaultValue": "adAdministrator" | |
| }, | |
| "adminPassword": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "The password for the Administrator account of the new VM and Domain" | |
| } | |
| }, | |
| "adVMSize": { | |
| "type": "string", | |
| "allowedValues": [ | |
| "Standard_D1", | |
| "Standard_DS1", | |
| "Standard_D2", | |
| "Standard_DS2", | |
| "Standard_D3", | |
| "Standard_DS3", | |
| "Standard_D4", | |
| "Standard_DS4", | |
| "Standard_D11", | |
| "Standard_DS11", | |
| "Standard_D12", | |
| "Standard_DS12", | |
| "Standard_D13", | |
| "Standard_DS13", | |
| "Standard_D14", | |
| "Standard_DS14", | |
| "Standard_D1_v2", | |
| "Standard_DS1_v2", | |
| "Standard_D2_v2", | |
| "Standard_DS2_v2", | |
| "Standard_D3_v2", | |
| "Standard_DS3_v2", | |
| "Standard_D4_v2", | |
| "Standard_DS4_v2", | |
| "Standard_D11_v2", | |
| "Standard_DS11_v2", | |
| "Standard_D12_v2", | |
| "Standard_DS12_v2", | |
| "Standard_D13_v2", | |
| "Standard_DS13_v2", | |
| "Standard_D14_v2", | |
| "Standard_DS14_v2" | |
| ], | |
| "metadata": { | |
| "description": "The size of the VM Created" | |
| }, | |
| "defaultValue": "Standard_DS2_v2" | |
| }, | |
| "imagePublisher": { | |
| "type": "string", | |
| "defaultValue": "MicrosoftWindowsServer", | |
| "metadata": { | |
| "description": "Image Publisher" | |
| } | |
| }, | |
| "imageOffer": { | |
| "type": "string", | |
| "defaultValue": "WindowsServer", | |
| "metadata": { | |
| "description": "Image Offer" | |
| } | |
| }, | |
| "imageSKU": { | |
| "type": "string", | |
| "defaultValue": "2012-R2-Datacenter", | |
| "metadata": { | |
| "description": "Image SKU" | |
| } | |
| }, | |
| "adAvailabilitySetName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the availability set that the AD VM is created in" | |
| }, | |
| "defaultValue": "adAvailabiltySet" | |
| }, | |
| "domainName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The FQDN of the AD Domain created " | |
| } | |
| }, | |
| "dnsPrefix": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The DNS prefix for the public IP address used by the Load Balancer" | |
| } | |
| }, | |
| "pdcRDPPort": { | |
| "type": "int", | |
| "metadata": { | |
| "description": "The public RDP port for the PDC VM" | |
| }, | |
| "defaultValue": 3389 | |
| }, | |
| "bdcRDPPort": { | |
| "type": "int", | |
| "metadata": { | |
| "description": "The public RDP port for the BDC VM" | |
| }, | |
| "defaultValue": 13389 | |
| }, | |
| "assetLocation": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The location of resources such as templates and DSC modules that the script is dependent" | |
| }, | |
| "defaultValue": "http://nityawestus.blob.core.windows.net/adtemplateha" | |
| }, | |
| "clusterName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the HDInsight cluster to create." | |
| } | |
| }, | |
| "clusterType": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Type of the HDInsight cluster to create." | |
| } | |
| }, | |
| "clusterWorkerNodeCount": { | |
| "type": "int", | |
| "metadata": { | |
| "description": "Specify worker node count" | |
| } | |
| }, | |
| "clusterLoginUserName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "These credentials can be used to submit jobs to the cluster and to log into cluster dashboards." | |
| } | |
| }, | |
| "clusterLoginPassword": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "The password must be at least 10 characters in length and must contain at least one digit, one non-alphanumeric character, and one upper or lower case letter." | |
| } | |
| }, | |
| "sshUserName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "These credentials can be used to remotely access the cluster." | |
| } | |
| }, | |
| "sshPublicKey": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "This field must be a valid SSH public key." | |
| } | |
| }, | |
| "sshPassword": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "The password must be at least 10 characters in length and must contain at least one digit, one non-alphanumeric character, and one upper or lower case letter." | |
| } | |
| }, | |
| "headnodeVMSize": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Specify head node VM size. Only use Extralarge for this preview." | |
| } | |
| }, | |
| "organizationalUnitDN": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Specify OU DN" | |
| } | |
| }, | |
| "newUserPrefix": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "This template will create 4 AD users with the given prefix e.g. if the prefix is 'testuser', there will be 4 users created named testuser1, testuser2, testuser3, testuser4" | |
| } | |
| }, | |
| "newUserPassword": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "Password for the new users. All the 4 users will have the same password. It is highly recommended that you change it as soon as the cluster is created" | |
| } | |
| }, | |
| "newGroupName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Name of the AD group to be created. The 4 users will be added to this group" | |
| } | |
| }, | |
| "secureLdapCertificate": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "Base 64 encoded certificate to use for configuring secure ldap. The subject name must be *.<domain name>. The certificate must have the private key and should be marked exportable" | |
| } | |
| }, | |
| "secureLdapCertificatePassword": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "Password for the secure ldap certificate" | |
| } | |
| }, | |
| }, | |
| "variables": { | |
| "adLBFE": "LBFE", | |
| "adLBBE": "LBBE", | |
| "adPDCRDPNAT": "adPDCRDP", | |
| "adBDCRDPNAT": "adBDCRDP", | |
| "VnetID": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", | |
| "adSubnetRef": "[concat(variables('VnetID'),'/subnets/',parameters('adSubnetName'))]", | |
| "adPDCNicId": "[resourceId('Microsoft.Network/networkInterfaces',parameters('adPDCNicName'))]", | |
| "adPDCIPConfigID": "[concat(variables('adPDCNicId'),'/ipConfigurations/ipconfig1')]", | |
| "adBDCNicId": "[resourceId('Microsoft.Network/networkInterfaces',parameters('adBDCNicName'))]", | |
| "adBDCIPConfigID": "[concat(variables('adBDCNicId'),'/ipConfigurations/ipconfig1')]", | |
| "adLBName": "adLoadBalancer", | |
| "adlbID": "[resourceId('Microsoft.Network/loadBalancers',variables('adLBName'))]", | |
| "adlbFEConfigID": "[concat(variables('adlbID'),'/frontendIPConfigurations/',variables('adLBFE'))]", | |
| "adPDCRDPNATRuleID": "[concat(variables('adlbID'),'/inboundNatRules/',variables('adPDCRDPNAT'))]", | |
| "adBDCRDPNATRuleID": "[concat(variables('adlbID'),'/inboundNatRules/',variables('adBDCRDPNAT'))]", | |
| "adBEAddressPoolID": "[concat(variables('adlbID'),'/backendAddressPools/',variables('adLBBE'))]", | |
| "adPDCDataDisk": "ADPDCDataDisk", | |
| "adBDCDataDisk": "ADBDCDataDisk", | |
| "adDataDiskSize": 1000, | |
| "vnetTemplateUri": "[concat(parameters('assetLocation'),'/nestedtemplates/vnet.json')]", | |
| "nicTemplateUri": "[concat(parameters('assetLocation'),'/nestedtemplates/nic.json')]", | |
| "vnetwithDNSTemplateUri": "[concat(parameters('assetLocation'),'/nestedtemplates/vnet-with-dns-server.json')]", | |
| "configureADBDCTemplateUri": "[concat(parameters('assetLocation'),'/nestedtemplates/configureADBDC.json')]", | |
| "adPDCModulesURL": "[concat(parameters('assetLocation'),'/DSC/CreateADPDC.ps1.zip')]", | |
| "adPDCConfigurationFunction": "CreateADPDC.ps1\\CreateADPDC", | |
| "adBDCPreparationModulesURL": "[concat(parameters('assetLocation'),'/DSC/PrepareADBDC.ps1.zip')]", | |
| "adBDCPreparationFunction": "PrepareADBDC.ps1\\PrepareADBDC", | |
| "adBDCConfigurationModulesURL": "[concat(parameters('assetLocation'),'/DSC/ConfigureADBDC.ps1.zip')]", | |
| "adBDCConfigurationFunction": "ConfigureADBDC.ps1\\ConfigureADBDC", | |
| "defaultApiVersion": "2015-05-01-preview", | |
| "clusterApiVersion": "2015-03-01-preview", | |
| "userGroupsArray": ["[parameters('newGroupName')]"], | |
| "ldapsUrlsArray" : ["[concat('ldaps://', parameters('domainName'),':636')]"] | |
| }, | |
| "resources": [ | |
| { | |
| "name": "[parameters('newStorageAccountName')]", | |
| "type": "Microsoft.Storage/storageAccounts", | |
| "apiVersion": "2016-05-01", | |
| "location": "[resourceGroup().location]", | |
| "properties": { | |
| }, | |
| "sku":{"name":"[parameters('storageAccountType')]"}, | |
| "kind":"Storage" | |
| }, | |
| { | |
| "name": "[parameters('publicIPAddressName')]", | |
| "type": "Microsoft.Network/publicIPAddresses", | |
| "apiVersion": "2016-10-01", | |
| "location": "[resourceGroup().location]", | |
| "properties": { | |
| "publicIPAllocationMethod": "[parameters('publicIPAddressType')]", | |
| "dnsSettings": { | |
| "domainNameLabel": "[parameters('dnsPrefix')]" | |
| } | |
| } | |
| }, | |
| { | |
| "name": "[parameters('adAvailabilitySetName')]", | |
| "type": "Microsoft.Compute/availabilitySets", | |
| "apiVersion": "2016-03-30", | |
| "location": "[resourceGroup().location]" | |
| }, | |
| { | |
| "name": "VNet", | |
| "type": "Microsoft.Resources/deployments", | |
| "apiVersion": "2016-09-01", | |
| "properties": { | |
| "mode": "Incremental", | |
| "templateLink": { | |
| "uri": "[variables('vnetTemplateUri')]", | |
| "contentVersion": "1.0.0.0" | |
| }, | |
| "parameters": { | |
| "virtualNetworkName": { | |
| "value": "[parameters('virtualNetworkName')]" | |
| }, | |
| "virtualNetworkAddressRange": { | |
| "value": "[parameters('virtualNetworkAddressRange')]" | |
| }, | |
| "subnetName": { | |
| "value": "[parameters('adSubnetName')]" | |
| }, | |
| "subnetRange": { | |
| "value": "[parameters('adSubnet')]" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "[variables('adLBName')]", | |
| "type": "Microsoft.Network/loadBalancers", | |
| "apiVersion": "2016-10-01", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName'))]" | |
| ], | |
| "properties": { | |
| "frontendIPConfigurations": [ | |
| { | |
| "name": "[variables('adLBFE')]", | |
| "properties": { | |
| "publicIPAddress": { | |
| "id": "[resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName'))]" | |
| } | |
| } | |
| } | |
| ], | |
| "backendAddressPools": [ | |
| { | |
| "name": "[variables('adLBBE')]" | |
| } | |
| ], | |
| "inboundNatRules": [ | |
| { | |
| "name": "[variables('adPDCRDPNAT')]", | |
| "properties": { | |
| "frontendIPConfiguration": { | |
| "id": "[variables('adlbFEConfigID')]" | |
| }, | |
| "protocol": "tcp", | |
| "frontendPort": "[parameters('pdcRDPPort')]", | |
| "backendPort": 3389, | |
| "enableFloatingIP": false | |
| } | |
| }, | |
| { | |
| "name": "[variables('adBDCRDPNAT')]", | |
| "properties": { | |
| "frontendIPConfiguration": { | |
| "id": "[variables('adlbFEConfigID')]" | |
| }, | |
| "protocol": "tcp", | |
| "frontendPort": "[parameters('bdcRDPPort')]", | |
| "backendPort": 3389, | |
| "enableFloatingIP": false | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "name": "[parameters('adPDCNicName')]", | |
| "type": "Microsoft.Network/networkInterfaces", | |
| "apiVersion": "2016-10-01", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "Microsoft.Resources/deployments/VNet", | |
| "[concat('Microsoft.Network/loadBalancers/',variables('adLBName'))]" | |
| ], | |
| "properties": { | |
| "ipConfigurations": [ | |
| { | |
| "name": "ipconfig1", | |
| "properties": { | |
| "privateIPAllocationMethod": "Static", | |
| "privateIPAddress": "[parameters('adPDCNicIPAddress')]", | |
| "subnet": { | |
| "id": "[variables('adSubnetRef')]" | |
| }, | |
| "loadBalancerBackendAddressPools": [ | |
| { | |
| "id": "[variables('adBEAddressPoolID')]" | |
| } | |
| ], | |
| "loadBalancerInboundNatRules": [ | |
| { | |
| "id": "[variables('adPDCRDPNATRuleID')]" | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "name": "[parameters('adBDCNicName')]", | |
| "type": "Microsoft.Network/networkInterfaces", | |
| "apiVersion": "2016-10-01", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "Microsoft.Resources/deployments/VNet", | |
| "[concat('Microsoft.Network/loadBalancers/',variables('adLBName'))]" | |
| ], | |
| "properties": { | |
| "ipConfigurations": [ | |
| { | |
| "name": "ipconfig1", | |
| "properties": { | |
| "privateIPAllocationMethod": "Static", | |
| "privateIPAddress": "[parameters('adBDCNicIPAddress')]", | |
| "subnet": { | |
| "id": "[variables('adSubnetRef')]" | |
| }, | |
| "loadBalancerBackendAddressPools": [ | |
| { | |
| "id": "[variables('adBEAddressPoolID')]" | |
| } | |
| ], | |
| "loadBalancerInboundNatRules": [ | |
| { | |
| "id": "[variables('adBDCRDPNATRuleID')]" | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "name": "[parameters('adPDCVMName')]", | |
| "type": "Microsoft.Compute/virtualMachines", | |
| "apiVersion": "2016-03-30", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Storage/storageAccounts',parameters('newStorageAccountName'))]", | |
| "[resourceId('Microsoft.Network/networkInterfaces',parameters('adPDCNicName'))]", | |
| "[resourceId('Microsoft.Compute/availabilitySets', parameters('adAvailabilitySetName'))]", | |
| "[resourceId('Microsoft.Network/loadBalancers',variables('adLBName'))]" | |
| ], | |
| "properties": { | |
| "hardwareProfile": { | |
| "vmSize": "[parameters('adVMSize')]" | |
| }, | |
| "availabilitySet": { | |
| "id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('adAvailabilitySetName'))]" | |
| }, | |
| "osProfile": { | |
| "computerName": "[parameters('adPDCVMName')]", | |
| "adminUsername": "[parameters('adminUsername')]", | |
| "adminPassword": "[parameters('adminPassword')]" | |
| }, | |
| "storageProfile": { | |
| "imageReference": { | |
| "publisher": "[parameters('imagePublisher')]", | |
| "offer": "[parameters('imageOffer')]", | |
| "sku": "[parameters('imageSKU')]", | |
| "version": "latest" | |
| }, | |
| "osDisk": { | |
| "name": "osdisk", | |
| "vhd": { | |
| "uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))).primaryEndpoints.blob,'vhds0/','osdisk.vhd')]" | |
| }, | |
| "caching": "ReadWrite", | |
| "createOption": "FromImage" | |
| }, | |
| "dataDisks": [ | |
| { | |
| "vhd": { | |
| "uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))).primaryEndpoints.blob,'vhds0/', variables('adPDCDataDisk'),'-1.vhd')]" | |
| }, | |
| "name": "[concat(parameters('adPDCVMName'),'-data-disk1')]", | |
| "caching": "None", | |
| "diskSizeGB": "[variables('adDataDiskSize')]", | |
| "lun": 0, | |
| "createOption": "empty" | |
| } | |
| ] | |
| }, | |
| "networkProfile": { | |
| "networkInterfaces": [ | |
| { | |
| "id": "[resourceId('Microsoft.Network/networkInterfaces',parameters('adPDCNicName'))]" | |
| } | |
| ] | |
| } | |
| }, | |
| "resources": [ | |
| { | |
| "name": "[concat(parameters('adPDCVMName'),'/CreateADForest')]", | |
| "type": "Microsoft.Compute/virtualMachines/extensions", | |
| "apiVersion": "2016-03-30", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Compute/virtualMachines', parameters('adPDCVMName'))]" | |
| ], | |
| "properties": { | |
| "publisher": "Microsoft.Powershell", | |
| "type": "DSC", | |
| "typeHandlerVersion": "2.21", | |
| "autoUpgradeMinorVersion": true, | |
| "settings": { | |
| "ModulesUrl": "[variables('adPDCModulesURL')]", | |
| "ConfigurationFunction": "[variables('adPDCConfigurationFunction')]", | |
| "Properties": { | |
| "DomainName": "[parameters('domainName')]", | |
| "LdapsCertificateContent": "[parameters('secureLdapCertificate')]", | |
| "LdapsCertificatePassword": "[parameters('secureLdapCertificatePassword')]", | |
| "NewGroupName": "[parameters('newGroupName')]", | |
| "AdminCreds": { | |
| "UserName": "[parameters('adminUsername')]", | |
| "Password": "PrivateSettingsRef:AdminPassword" | |
| }, | |
| "NewUsercreds": { | |
| "UserName": "[parameters('newUserPrefix')]", | |
| "Password": "PrivateSettingsRef:NewUserPassword" | |
| }, | |
| "DnsServerZone": "[parameters('dnsServerZone')]", | |
| } | |
| }, | |
| "protectedSettings": { | |
| "Items": { | |
| "AdminPassword": "[parameters('adminPassword')]", | |
| "NewUserPassword": "[parameters('newUserPassword')]" | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| "name": "UpdateVNetDNS1", | |
| "type": "Microsoft.Resources/deployments", | |
| "apiVersion": "2016-09-01", | |
| "dependsOn": [ | |
| "[concat('Microsoft.Compute/virtualMachines/', parameters('adPDCVMName'),'/extensions/CreateADForest')]" | |
| ], | |
| "properties": { | |
| "mode": "Incremental", | |
| "templateLink": { | |
| "uri": "[variables('vnetwithDNSTemplateUri')]", | |
| "contentVersion": "1.0.0.0" | |
| }, | |
| "parameters": { | |
| "virtualNetworkName": { | |
| "value": "[parameters('virtualNetworkName')]" | |
| }, | |
| "virtualNetworkAddressRange": { | |
| "value": "[parameters('virtualNetworkAddressRange')]" | |
| }, | |
| "subnetName": { | |
| "value": "[parameters('adSubnetName')]" | |
| }, | |
| "subnetRange": { | |
| "value": "[parameters('adSubnet')]" | |
| }, | |
| "DNSServerAddress": { | |
| "value": [ | |
| "[parameters('adPDCNicIPAddress')]" | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "UpdateBDCNIC", | |
| "type": "Microsoft.Resources/deployments", | |
| "apiVersion": "2015-01-01", | |
| "dependsOn": [ | |
| "[concat('Microsoft.Network/networkInterfaces/',parameters('adBDCNicName'))]", | |
| "Microsoft.Resources/deployments/UpdateVNetDNS1" | |
| ], | |
| "properties": { | |
| "mode": "Incremental", | |
| "templateLink": { | |
| "uri": "[variables('nicTemplateUri')]", | |
| "contentVersion": "1.0.0.0" | |
| }, | |
| "parameters": { | |
| "nicName": { | |
| "value": "[parameters('adBDCNicName')]" | |
| }, | |
| "ipConfigurations": { | |
| "value": [ | |
| { | |
| "name": "ipconfig1", | |
| "properties": { | |
| "privateIPAllocationMethod": "Static", | |
| "privateIPAddress": "[parameters('adBDCNicIPAddress')]", | |
| "subnet": { | |
| "id": "[variables('adSubnetRef')]" | |
| }, | |
| "loadBalancerBackendAddressPools": [ | |
| { | |
| "id": "[variables('adBEAddressPoolID')]" | |
| } | |
| ], | |
| "loadBalancerInboundNatRules": [ | |
| { | |
| "id": "[variables('adBDCRDPNATRuleID')]" | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| }, | |
| "dnsServers": { | |
| "value": [ | |
| "[parameters('adPDCNicIPAddress')]" | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "[parameters('adBDCVMName')]", | |
| "type": "Microsoft.Compute/virtualMachines", | |
| "apiVersion": "2016-03-30", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Storage/storageAccounts',parameters('newStorageAccountName'))]", | |
| "[resourceId('Microsoft.Network/networkInterfaces',parameters('adBDCNicName'))]", | |
| "[resourceId('Microsoft.Compute/availabilitySets', parameters('adAvailabilitySetName'))]", | |
| "[resourceId('Microsoft.Network/loadBalancers',variables('adLBName'))]" | |
| ], | |
| "properties": { | |
| "hardwareProfile": { | |
| "vmSize": "[parameters('adVMSize')]" | |
| }, | |
| "availabilitySet": { | |
| "id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('adAvailabilitySetName'))]" | |
| }, | |
| "osProfile": { | |
| "computerName": "[parameters('adBDCVMName')]", | |
| "adminUsername": "[parameters('adminUsername')]", | |
| "adminPassword": "[parameters('adminPassword')]" | |
| }, | |
| "storageProfile": { | |
| "imageReference": { | |
| "publisher": "[parameters('imagePublisher')]", | |
| "offer": "[parameters('imageOffer')]", | |
| "sku": "[parameters('imageSKU')]", | |
| "version": "latest" | |
| }, | |
| "osDisk": { | |
| "name": "osdisk", | |
| "vhd": { | |
| "uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))).primaryEndpoints.blob,'vhds1/','osdisk.vhd')]" | |
| }, | |
| "caching": "ReadWrite", | |
| "createOption": "FromImage" | |
| }, | |
| "dataDisks": [ | |
| { | |
| "vhd": { | |
| "uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))).primaryEndpoints.blob,'vhds1/',variables('adBDCDataDisk'),'-1.vhd')]" | |
| }, | |
| "name": "[concat(parameters('adBDCVMName'),'-data-disk1')]", | |
| "caching": "None", | |
| "diskSizeGB": "[variables('adDataDiskSize')]", | |
| "lun": 0, | |
| "createOption": "empty" | |
| } | |
| ] | |
| }, | |
| "networkProfile": { | |
| "networkInterfaces": [ | |
| { | |
| "id": "[resourceId('Microsoft.Network/networkInterfaces',parameters('adBDCNicName'))]" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "type": "Microsoft.Compute/virtualMachines/extensions", | |
| "name": "[concat(parameters('adBDCVMName'),'/PrepareBDC')]", | |
| "apiVersion": "2016-03-30", | |
| "location": "[resourceGroup().location]", | |
| "dependsOn": [ | |
| "[concat('Microsoft.Compute/virtualMachines/', parameters('adBDCVMName'))]" | |
| ], | |
| "properties": { | |
| "publisher": "Microsoft.Powershell", | |
| "type": "DSC", | |
| "typeHandlerVersion": "2.21", | |
| "autoUpgradeMinorVersion": true, | |
| "settings": { | |
| "ModulesUrl": "[variables('adBDCPreparationModulesURL')]", | |
| "ConfigurationFunction": "[variables('adBDCPreparationFunction')]", | |
| "Properties": { | |
| "DNSServer": "[parameters('adPDCNicIPAddress')]" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "ConfiguringBackupADDomainController", | |
| "type": "Microsoft.Resources/deployments", | |
| "apiVersion": "2016-09-01", | |
| "dependsOn": [ | |
| "[concat('Microsoft.Compute/virtualMachines/',parameters('adBDCVMName'),'/extensions/PrepareBDC')]", | |
| "Microsoft.Resources/deployments/UpdateBDCNIC" | |
| ], | |
| "properties": { | |
| "mode": "Incremental", | |
| "templateLink": { | |
| "uri": "[variables('configureADBDCTemplateUri')]", | |
| "contentVersion": "1.0.0.0" | |
| }, | |
| "parameters": { | |
| "adBDCVMName": { | |
| "value": "[parameters('adBDCVMName')]" | |
| }, | |
| "location": { | |
| "value": "[resourceGroup().location]" | |
| }, | |
| "adminUsername": { | |
| "value": "[parameters('adminUsername')]" | |
| }, | |
| "adminPassword": { | |
| "value": "[parameters('adminPassword')]" | |
| }, | |
| "domainName": { | |
| "value": "[parameters('domainName')]" | |
| }, | |
| "secureLdapCertificate": { | |
| "value": "[parameters('secureLdapCertificate')]" | |
| }, | |
| "secureLdapCertificatePassword": { | |
| "value": "[parameters('secureLdapCertificatePassword')]" | |
| }, | |
| "adBDCConfigurationFunction": { | |
| "value": "[variables('adBDCConfigurationFunction')]" | |
| }, | |
| "adBDCConfigurationModulesURL": { | |
| "value": "[variables('adBDCConfigurationModulesURL')]" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "UpdateVNetDNS2", | |
| "type": "Microsoft.Resources/deployments", | |
| "apiVersion": "2016-09-01", | |
| "dependsOn": [ | |
| "Microsoft.Resources/deployments/ConfiguringBackupADDomainController" | |
| ], | |
| "properties": { | |
| "mode": "Incremental", | |
| "templateLink": { | |
| "uri": "[variables('vnetwithDNSTemplateUri')]", | |
| "contentVersion": "1.0.0.0" | |
| }, | |
| "parameters": { | |
| "virtualNetworkName": { | |
| "value": "[parameters('virtualNetworkName')]" | |
| }, | |
| "virtualNetworkAddressRange": { | |
| "value": "[parameters('virtualNetworkAddressRange')]" | |
| }, | |
| "subnetName": { | |
| "value": "[parameters('adSubnetName')]" | |
| }, | |
| "subnetRange": { | |
| "value": "[parameters('adSubnet')]" | |
| }, | |
| "DNSServerAddress": { | |
| "value": [ | |
| "[parameters('adPDCNicIPAddress')]", | |
| "[parameters('adBDCNicIPAddress')]" | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "apiVersion": "[variables('clusterApiVersion')]", | |
| "location": "[resourceGroup().location]", | |
| "name": "[parameters('clusterName')]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Resources/deployments', 'UpdateVNetDNS2')]" | |
| ], | |
| "properties": { | |
| "clusterVersion": "3.6", | |
| "osType": "Linux", | |
| "tier": "premium", | |
| "clusterDefinition": { | |
| "kind": "[parameters('clusterType')]", | |
| "configurations": { | |
| "gateway": { | |
| "restAuthCredential.isEnabled": "true", | |
| "restAuthCredential.username": "[parameters('clusterLoginUserName')]", | |
| "restAuthCredential.password": "[parameters('clusterLoginPassword')]" | |
| } | |
| } | |
| }, | |
| "storageProfile": { | |
| "storageaccounts": [{ | |
| "name": "[concat(parameters('newStorageAccountName'),'.blob.core.windows.net')]", | |
| "isDefault": true, | |
| "container": "[parameters('clusterName')]", | |
| "key": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('newStorageAccountName')), variables('defaultApiVersion')).key1]" | |
| }] | |
| }, | |
| "securityProfile": { | |
| "directoryType": "ActiveDirectory", | |
| "domain": "[parameters('domainName')]", | |
| "organizationalUnitDN": "[parameters('organizationalUnitDN')]", | |
| "ldapsUrls": "[variables('ldapsUrlsArray')]", | |
| "domainUsername": "[concat(parameters('adminUsername'), '@', parameters('domainName'))]", | |
| "domainUserPassword": "[parameters('adminPassword')]", | |
| "clusterUsersGroupDNs": "[variables('userGroupsArray')]" | |
| }, | |
| "computeProfile": { | |
| "roles": [{ | |
| "name": "headnode", | |
| "targetInstanceCount": 2, | |
| "hardwareProfile": { | |
| "vmSize": "[parameters('headnodeVMSize')]" | |
| }, | |
| "osProfile": { | |
| "linuxOperatingSystemProfile": { | |
| "username": "[parameters('sshUserName')]", | |
| "password": "[parameters('sshPassword')]", | |
| "sshProfile": { | |
| "publicKeys": [{ | |
| "certificateData": "[parameters('sshPublicKey')]" | |
| }] | |
| } | |
| } | |
| }, | |
| "virtualNetworkProfile": { | |
| "id": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", | |
| "subnet": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('adSubnetName'))]" | |
| }, | |
| "scriptActions": [] | |
| }, { | |
| "name": "workernode", | |
| "targetInstanceCount": "[parameters('clusterWorkerNodeCount')]", | |
| "hardwareProfile": { | |
| "vmSize": "ExtraLarge" | |
| }, | |
| "osProfile": { | |
| "linuxOperatingSystemProfile": { | |
| "username": "[parameters('sshUserName')]", | |
| "password": "[parameters('sshPassword')]", | |
| "sshProfile": { | |
| "publicKeys": [{ | |
| "certificateData": "[parameters('sshPublicKey')]" | |
| }] | |
| } | |
| } | |
| }, | |
| "virtualNetworkProfile": { | |
| "id": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", | |
| "subnet": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('adSubnetName'))]" | |
| }, | |
| "scriptActions": [] | |
| }, { | |
| "name": "zookeepernode", | |
| "targetInstanceCount": 3, | |
| "hardwareProfile": { | |
| "vmSize": "Small" | |
| }, | |
| "osProfile": { | |
| "linuxOperatingSystemProfile": { | |
| "username": "[parameters('sshUserName')]", | |
| "password": "[parameters('sshPassword')]", | |
| "sshProfile": { | |
| "publicKeys": [{ | |
| "certificateData": "[parameters('sshPublicKey')]" | |
| }] | |
| } | |
| } | |
| }, | |
| "virtualNetworkProfile": { | |
| "id": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", | |
| "subnet": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('adSubnetName'))]" | |
| }, | |
| "scriptActions": [] | |
| }] | |
| } | |
| }, | |
| "tags": { | |
| }, | |
| "type": "Microsoft.HDInsight/clusters" | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment