mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
189 lines
7.4 KiB
JSON
189 lines
7.4 KiB
JSON
{
|
|
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
|
|
"contentVersion": "1.0.0.1",
|
|
"parameters": {
|
|
"location": {
|
|
"type": "string",
|
|
"defaultValue": "[resourceGroup().location]",
|
|
"metadata": {
|
|
"description": "Enter location. If you leave this field blank resource group location would be used."
|
|
}
|
|
},
|
|
"virtualNetworkName": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "Enter virtual network name. If you leave this field blank name will be created by the template."
|
|
}
|
|
},
|
|
"administratorLogin": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "Enter user name."
|
|
}
|
|
},
|
|
"administratorLoginPassword": {
|
|
"type": "securestring",
|
|
"metadata": {
|
|
"description": "Enter password."
|
|
}
|
|
},
|
|
"virtualMachineName": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "VM name."
|
|
}
|
|
},
|
|
"managementSubnetName": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "VM subnet name."
|
|
}
|
|
}
|
|
},
|
|
"variables": {
|
|
"virtualMachineSize": "Standard_B2s",
|
|
"networkInterfaceName": "[concat(parameters('virtualMachineName'),'-nic0')]",
|
|
"publicIPAddressName": "[concat(parameters('virtualMachineName'),'-pip')]",
|
|
"networkSecurityGroupName": "[concat(parameters('virtualMachineName'),'-nsg')]",
|
|
"scriptFileUri": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-sqlmi-new-vnet-w-jumpbox/installSSMS.ps1"
|
|
},
|
|
"resources": [
|
|
{
|
|
"name": "[parameters('virtualMachineName')]",
|
|
"type": "Microsoft.Compute/virtualMachines",
|
|
"apiVersion": "2018-06-01",
|
|
"location": "[parameters('location')]",
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Network/networkInterfaces/', variables('networkInterfaceName'))]"
|
|
],
|
|
"properties": {
|
|
"osProfile": {
|
|
"computerName": "[parameters('virtualMachineName')]",
|
|
"adminUsername": "[parameters('administratorLogin')]",
|
|
"adminPassword": "[parameters('administratorLoginPassword')]",
|
|
"windowsConfiguration": {
|
|
"provisionVmAgent": "true"
|
|
}
|
|
},
|
|
"hardwareProfile": {
|
|
"vmSize": "[variables('virtualMachineSize')]"
|
|
},
|
|
"storageProfile": {
|
|
"imageReference": {
|
|
"publisher": "MicrosoftWindowsServer",
|
|
"offer": "WindowsServer",
|
|
"sku": "2016-Datacenter",
|
|
"version": "latest"
|
|
},
|
|
"osDisk": {
|
|
"createOption": "FromImage",
|
|
"managedDisk": {
|
|
"storageAccountType": "Standard_LRS"
|
|
}
|
|
},
|
|
"dataDisks": []
|
|
},
|
|
"networkProfile": {
|
|
"networkInterfaces": [
|
|
{
|
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"resources": [
|
|
{
|
|
"name": "SetupChocolatey",
|
|
"type": "extensions",
|
|
"location": "[parameters('location')]",
|
|
"apiVersion": "2018-06-01",
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
|
|
],
|
|
"tags": {
|
|
"displayName": "SetupChocolatey"
|
|
},
|
|
"properties": {
|
|
"publisher": "Microsoft.Compute",
|
|
"type": "CustomScriptExtension",
|
|
"typeHandlerVersion": "1.9",
|
|
"autoUpgradeMinorVersion": true,
|
|
"settings": {
|
|
"fileUris": [
|
|
"[variables('scriptFileUri')]"
|
|
],
|
|
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File installSSMS.ps1"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
"name": "[variables('networkInterfaceName')]",
|
|
"type": "Microsoft.Network/networkInterfaces",
|
|
"apiVersion": "2017-10-01",
|
|
"location": "[parameters('location')]",
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Network/publicIpAddresses/', variables('publicIPAddressName'))]",
|
|
"[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]"
|
|
],
|
|
"properties": {
|
|
"ipConfigurations": [
|
|
{
|
|
"name": "ipconfig1",
|
|
"properties": {
|
|
"subnet": {
|
|
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('managementSubnetName'))]"
|
|
},
|
|
"privateIPAllocationMethod": "Dynamic",
|
|
"publicIpAddress": {
|
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpAddressName'))]"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"networkSecurityGroup": {
|
|
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "[variables('publicIpAddressName')]",
|
|
"type": "Microsoft.Network/publicIPAddresses",
|
|
"apiVersion": "2017-08-01",
|
|
"location": "[parameters('location')]",
|
|
"properties": {
|
|
"publicIPAllocationMethod": "Dynamic"
|
|
},
|
|
"sku": {
|
|
"name": "Basic"
|
|
}
|
|
},
|
|
{
|
|
"name": "[variables('networkSecurityGroupName')]",
|
|
"type": "Microsoft.Network/networkSecurityGroups",
|
|
"apiVersion": "2018-01-01",
|
|
"location": "[parameters('location')]",
|
|
"properties": {
|
|
"securityRules": [
|
|
{
|
|
"name": "RDP",
|
|
"properties": {
|
|
"priority": 300,
|
|
"protocol": "Tcp",
|
|
"access": "Allow",
|
|
"direction": "Inbound",
|
|
"sourceApplicationSecurityGroups": [],
|
|
"destinationApplicationSecurityGroups": [],
|
|
"sourceAddressPrefix": "*",
|
|
"sourcePortRange": "*",
|
|
"destinationAddressPrefix": "*",
|
|
"destinationPortRange": "3389"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
} |