163 строки
6.1 KiB
JSON
163 строки
6.1 KiB
JSON
{
|
|
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
|
"contentVersion": "1.0.0.0",
|
|
"parameters": {
|
|
"adPDCVMName": {
|
|
"type": "string"
|
|
},
|
|
"adAvailabilitySetName": {
|
|
"type": "string"
|
|
},
|
|
"adVMSize": {
|
|
"type": "string"
|
|
},
|
|
"adminUsername": {
|
|
"type": "string"
|
|
},
|
|
"adminPassword": {
|
|
"type": "securestring"
|
|
},
|
|
"adImagePublisher": {
|
|
"type": "string"
|
|
},
|
|
"adImageOffer": {
|
|
"type": "string"
|
|
},
|
|
"adImageSKU": {
|
|
"type": "string"
|
|
},
|
|
"adPDCNicName": {
|
|
"type": "string"
|
|
},
|
|
"adPDCConfigurationFunction": {
|
|
"type": "string"
|
|
},
|
|
"adPDCModulesURL": {
|
|
"type": "string"
|
|
},
|
|
"location": {
|
|
"type": "string"
|
|
},
|
|
"dcStorageAccountName": {
|
|
"type": "string"
|
|
},
|
|
"sqlStorageAccountName": {
|
|
"type": "string"
|
|
},
|
|
"vmContainerName": {
|
|
"type": "string"
|
|
},
|
|
"domainName": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"variables": {
|
|
"dcstorageName": "[parameters('dcStorageAccountName')]",
|
|
"diagstorageName": "[concat(uniquestring(parameters('sqlStorageAccountName')), 'diag')]"
|
|
},
|
|
"resources": [
|
|
{
|
|
"type": "Microsoft.Compute/availabilitySets",
|
|
"name": "[parameters('adAvailabilitySetName')]",
|
|
"apiVersion": "2016-03-30",
|
|
"location": "[parameters('location')]"
|
|
},
|
|
{
|
|
"apiVersion": "2016-03-30",
|
|
"type": "Microsoft.Compute/virtualMachines",
|
|
"name": "[parameters('adPDCVMName')]",
|
|
"location": "[parameters('location')]",
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Compute/availabilitySets/',parameters('adAvailabilitySetName'))]"
|
|
],
|
|
"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('adImagePublisher')]",
|
|
"offer": "[parameters('adImageOffer')]",
|
|
"sku": "[parameters('adImageSKU')]",
|
|
"version": "latest"
|
|
},
|
|
"osDisk": {
|
|
"name": "osdisk",
|
|
"vhd": {
|
|
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('dcstorageName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob ,parameters('vmContainerName'),'/', parameters('adPDCVMName'), '0','-osdisk.vhd')]"
|
|
},
|
|
"caching": "ReadWrite",
|
|
"createOption": "FromImage"
|
|
},
|
|
"dataDisks": [
|
|
{
|
|
"vhd": {
|
|
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('dcstorageName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob ,parameters('vmContainerName'),'/', parameters('adPDCVMName'), '0','data-1.vhd')]"
|
|
},
|
|
"name": "[concat(parameters('adPDCVMName'),'-data-disk1')]",
|
|
"createOption": "empty",
|
|
"caching": "None",
|
|
"diskSizeGB": 128,
|
|
"lun": 0
|
|
}
|
|
]
|
|
},
|
|
"networkProfile": {
|
|
"networkInterfaces": [
|
|
{
|
|
"id": "[resourceId(resourceGroup().name,'Microsoft.Network/networkInterfaces',parameters('adPDCNicName'))]"
|
|
}
|
|
]
|
|
},
|
|
"diagnosticsProfile": {
|
|
"bootDiagnostics": {
|
|
"enabled": "true",
|
|
"storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('diagstorageName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob)]"
|
|
}
|
|
}
|
|
},
|
|
"resources": [
|
|
{
|
|
"type": "Microsoft.Compute/virtualMachines/extensions",
|
|
"name": "[concat(parameters('adPDCVMName'),'/InstallDomainController')]",
|
|
"apiVersion": "2016-03-30",
|
|
"location": "[parameters('location')]",
|
|
"dependsOn": [
|
|
"[resourceId('Microsoft.Compute/virtualMachines', parameters('adPDCVMName'))]"
|
|
],
|
|
"properties": {
|
|
"publisher": "Microsoft.Powershell",
|
|
"type": "DSC",
|
|
"typeHandlerVersion": "2.19",
|
|
"autoUpgradeMinorVersion": true,
|
|
"settings": {
|
|
"modulesURL": "[parameters('adPDCModulesURL')]",
|
|
"configurationFunction": "[parameters('adPDCConfigurationFunction')]",
|
|
"properties": {
|
|
"domainName": "[parameters('domainName')]",
|
|
"adminCreds": {
|
|
"userName": "[parameters('adminUserName')]",
|
|
"password": "PrivateSettingsRef:adminPassword"
|
|
}
|
|
}
|
|
},
|
|
"protectedSettings": {
|
|
"items": {
|
|
"adminPassword": "[parameters('adminPassword')]"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"outputs": {}
|
|
} |