updated resource names, introduced tools server vm

This commit is contained in:
jdvcDev 2021-08-26 14:36:27 -06:00
Родитель 78cb295b38
Коммит 7c6456b5d6
2 изменённых файлов: 229 добавлений и 66 удалений

Просмотреть файл

@ -93,7 +93,7 @@
"description": "The Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version."
}
},
"location": {
"resourceLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
@ -152,10 +152,6 @@
"defaultValue": "bastion-host",
"type": "String"
},
"publicIPAddresses_appcontainerization_bastion_ip_name": {
"defaultValue": "appcontainerization-bastion-ip",
"type": "String"
},
"_artifactsLocation": {
"type": "string",
"metadata": {
@ -168,19 +164,35 @@
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
},
"defaultValue": ""
},
"vmTCCustomScriptFileName": {
"type": "string",
"metadata": {
"description": "Tool server setup script name"
}
},
"vmTCCustomScriptUri": {
"type": "string",
"metadata": {
"description": "Tool server setup script base path"
}
}
},
"variables": {
"imagePublisher": "Canonical",
"imageOffer": "UbuntuServer",
"nicName": "myVMNic",
"nsgName": "myNSG",
"vmName": "TomcatServer",
"lnicName": "tomcatVMNic",
"nsgName": "labNSG",
"lvmName": "TomcatServer",
"appContainerizationToolServer": "tomcatMigrate-toolclient",
"tnicName": "toolVMNic",
"addressPrefix": "10.0.0.0/16",
"subnetName": "Subnet",
"subnetName": "labSubnet",
"subnetPrefix": "10.0.0.0/24",
"publicIPAddressName": "myPublicIP",
"virtualNetworkName": "MyVNET",
"publicIPAddressName": "tomcatPublicIP",
"tpublicIPAddressName": "toolPublicIP",
"bpublicIPAddressName": "bastionPublicIP",
"virtualNetworkName": "labVNET",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
@ -192,14 +204,15 @@
]
}
},
"networkSecurityGroupName": "default-NSG"
"networkSecurityGroupName": "default-NSG",
"tnetworkSecurityGroupName": "default-Tool-NSG"
},
"resources": [
{
"apiVersion": "2019-06-01",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('publicIPAddressName')]",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"sku": {
"name": "Basic"
},
@ -207,11 +220,27 @@
"publicIPAllocationMethod": "Dynamic"
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-11-01",
"name": "[variables('tpublicIPAddressName')]",
"location": "[parameters('resourceLocation')]",
"sku": {
"name": "Basic",
"tier": "Regional"
},
"properties": {
"publicIPAddressVersion": "IPv4",
"publicIPAllocationMethod": "Dynamic",
"idleTimeoutInMinutes": 4,
"ipTags": []
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-11-01",
"name": "[parameters('publicIPAddresses_appcontainerization_bastion_ip_name')]",
"location": "[parameters('location')]",
"name": "[variables('bpublicIPAddressName')]",
"location": "[parameters('resourceLocation')]",
"sku": {
"name": "Standard",
"tier": "Regional"
@ -228,7 +257,7 @@
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-08-01",
"name": "[variables('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"properties": {
"securityRules": [
{
@ -273,11 +302,20 @@
]
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-11-01",
"name": "[variables('tnetworkSecurityGroupName')]",
"location": "[parameters('resourceLocation')]",
"properties": {
"securityRules": []
}
},
{
"apiVersion": "2019-06-01",
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
],
@ -313,8 +351,8 @@
{
"apiVersion": "2019-06-01",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"location": "[parameters('location')]",
"name": "[variables('lnicName')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
@ -340,11 +378,49 @@
}
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-11-01",
"name": "[variables('tnicName')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', variables('tpublicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('tnetworkSecurityGroupName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAddress": "10.0.0.4",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('tpublicIPAddressName'))]"
},
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]"
},
"primary": true,
"privateIPAddressVersion": "IPv4"
}
}
],
"dnsSettings": {
"dnsServers": []
},
"enableAcceleratedNetworking": false,
"enableIPForwarding": false,
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('tnetworkSecurityGroupName'))]"
}
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-06-01",
"name": "[variables('nsgName')]",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"properties": {
"securityRules": [
{
@ -395,17 +471,17 @@
{
"apiVersion": "2019-07-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[parameters('location')]",
"name": "[variables('lvmName')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
"[resourceId('Microsoft.Network/networkInterfaces', variables('lnicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[variables('vmName')]",
"computerName": "[variables('lvmName')]",
"adminUsername": "[parameters('vmAdminUsername')]",
"adminPassword": "[parameters('vmAdminPasswordOrKey')]",
"linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('linuxConfiguration'))]"
@ -419,7 +495,7 @@
},
"osDisk": {
"osType": "Linux",
"name": "[concat(variables('vmName'),'_OSDisk')]",
"name": "[concat(variables('lvmName'),'_OSDisk')]",
"caching": "ReadWrite",
"createOption": "FromImage",
"managedDisk": {
@ -429,7 +505,7 @@
"dataDisks": [
{
"lun": 0,
"name": "[concat(variables('vmName'),'_DataDisk_0')]",
"name": "[concat(variables('lvmName'),'_DataDisk_0')]",
"createOption": "Empty",
"caching": "None",
"writeAcceleratorEnabled": false,
@ -444,7 +520,7 @@
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('lnicName'))]"
}
]
}
@ -454,9 +530,9 @@
"type": "Microsoft.Network/bastionHosts",
"apiVersion": "2020-11-01",
"name": "[parameters('bastionHosts_bastion_name')]",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_appcontainerization_bastion_ip_name'))]",
"[resourceId('Microsoft.Network/publicIPAddresses', variables('bpublicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
],
"sku": {
@ -470,7 +546,7 @@
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_appcontainerization_bastion_ip_name'))]"
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('bpublicIPAddressName'))]"
},
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), 'AzureBastionSubnet')]"
@ -484,7 +560,7 @@
"type": "Microsoft.DBforMySQL/servers",
"apiVersion": "2017-12-01-preview",
"name": "[parameters('mySqlServername')]",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"sku": {
"name": "GP_Gen5_2",
"tier": "GeneralPurpose",
@ -514,20 +590,101 @@
}
]
},
/*
{
"type": "Microsoft.DBforMySQL/servers/configurations",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('mySqlServername'), '/timezone')]",
"dependsOn": [
"[resourceId('Microsoft.DBforMySQL/servers', parameters('mySqlServername'))]"
],
"properties": {
"value": "US/Pacific",
"source": "time_zone"
}
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-12-01",
"name": "[variables('appContainerizationToolServer')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('tnicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "Standard_DS1_v2"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2016-Datacenter",
"version": "latest"
},
"osDisk": {
"osType": "Windows",
"name": "[concat(variables('appContainerizationToolServer'), '_OsDisk_1_f8ecd33591214460b39574be24c69583')]",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Premium_LRS"
},
"diskSizeGB": 127
},
"dataDisks": [
{
"lun": 1,
"name": "[concat(variables('appContainerizationToolServer'), '_DataDisk_1')]",
"createOption": "Empty",
"caching": "None",
"writeAcceleratorEnabled": false,
"managedDisk": {
"storageAccountType": "Premium_LRS"
},
"diskSizeGB": 32,
"toBeDetached": false
}
]
},
"osProfile": {
"computerName": "toolclient",
"adminUsername": "adminuser",
"adminPassword": "[parameters('vmAdminPasswordOrKey')]",
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true,
"patchSettings": {
"patchMode": "AutomaticByOS",
"enableHotpatching": false
}
},
"secrets": [],
"allowExtensionOperations": true
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('tnicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true
}
}
},
"resources": [
{
"name": "SetupLabVm",
"type": "extensions",
"apiVersion": "2020-06-01",
"location": "[parameters('resourceLocation')]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"protectedSettings": {},
"typeHandlerVersion": "1.9",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": ["[concat(parameters('vmTCCustomScriptUri'), parameters('vmTCCustomScriptFileName'))]"],
"commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File ', parameters('vmTCCustomScriptFileName'))]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines/', variables('appContainerizationToolServer'))]"
]
}
]
},
*/
{
"type": "Microsoft.DBforMySQL/servers/firewallRules",
"apiVersion": "2017-12-01-preview",
@ -541,24 +698,24 @@
}
},
{
"type": "Microsoft.DBforMySQL/servers/firewallRules",
"apiVersion": "2017-12-01-preview",
"name": "[concat(parameters('mySqlServername'), '/AllowAllWindowsDevIps')]",
"dependsOn": [
"[resourceId('Microsoft.DBforMySQL/servers', parameters('mySqlServername'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "255.255.255.255"
}
},
"type": "Microsoft.DBforMySQL/servers/firewallRules",
"apiVersion": "2017-12-01-preview",
"name": "[concat(parameters('mySqlServername'), '/AllowAllWindowsDevIps')]",
"dependsOn": [
"[resourceId('Microsoft.DBforMySQL/servers', parameters('mySqlServername'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "255.255.255.255"
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'),'/installscript')]",
"name": "[concat(variables('lvmName'),'/installscript')]",
"apiVersion": "2019-07-01",
"location": "[parameters('location')]",
"location": "[parameters('resourceLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]",
"[resourceId('Microsoft.Compute/virtualMachines', variables('lvmName'))]",
"[resourceId('Microsoft.DBforMySQL/servers', parameters('mySqlServername'))]"
],
"properties": {
@ -598,4 +755,4 @@
}
}
]
}
}

Просмотреть файл

@ -6,7 +6,7 @@
"value": "openjdk-11-jdk"
},
"tomcatPackageName": {
"value":"https://downloads.apache.org/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gz"
"value":"https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.52/bin/apache-tomcat-9.0.52.tar.gz"
},
"airsonicPackageName": {
"value":"https://github.com/airsonic/airsonic/releases/download/v10.6.2/airsonic.war"
@ -15,26 +15,26 @@
"value":"https://downloads.mysql.com/archives/get/p/3/file/mysql-connector-java-5.1.48.tar.gz"
},
"_artifactsLocation": {
"value":"https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/scripts/vm/"
"value":"https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/scripts/vm/"
},
"tomcatServiceFile": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/resource/tomcat/tomcat9.service"
"value": "https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/resource/tomcat/tomcat9.service"
},
"tomcatContext": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/resource/tomcat/webapp/context.xml"
"value": "https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/resource/tomcat/webapp/context.xml"
},
"tomcatManagerContext": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/resource/tomcat/manager/context.xml"
"value": "https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/resource/tomcat/manager/context.xml"
},
"tomcatHostManagerContext": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/resource/tomcat/host-manager/context.xml"
"value": "https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/resource/tomcat/host-manager/context.xml"
},
"tomcatUsersFile": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/resource/tomcat/conf/tomcat-users.xml"
"value": "https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/resource/tomcat/conf/tomcat-users.xml"
},
"tomcatServerConf": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/Java%20Containerization/resource/tomcat/conf/server.xml"
"value": "https://raw.githubusercontent.com/Lantern-Cloud-Services/MTC_APPContainerization/windowsToolsVM/Java%20Containerization/resource/tomcat/conf/server.xml"
},
"vmAdminUsername": {
"value": "adminUser"
@ -53,6 +53,12 @@
},
"mysqlClientPackage": {
"value": "mysql-client-core-5.7"
},
"vmTCCustomScriptFileName": {
"value": "configure-labvm.ps1"
},
"vmTCCustomScriptUri": {
"value": "https://raw.githubusercontent.com/microsoft/MTC_APPContainerization/main/ASP.NET%20Containerization/"
}
}
}