{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "virtualMachines_az104_06_vm0_name": { "defaultValue": "az104-06-vm0", "type": "String" }, "virtualMachines_az104_06_vm1_name": { "defaultValue": "az104-06-vm1", "type": "String" }, "virtualMachines_az104_06_vm2_name": { "defaultValue": "az104-06-vm2", "type": "String" }, "virtualNetworks_az104_06_vnet1_name": { "defaultValue": "az104-06-vnet1", "type": "String" }, "networkInterfaces_az104_06_nic0_name": { "defaultValue": "az104-06-nic0", "type": "String" }, "networkInterfaces_az104_06_nic1_name": { "defaultValue": "az104-06-nic1", "type": "String" }, "networkInterfaces_az104_06_nic2_name": { "defaultValue": "az104-06-nic2", "type": "String" }, "networkSecurityGroups_az104_06_nsg1_name": { "defaultValue": "az104-06-nsg1", "type": "String" }, "adminPassword": { "defaultValue": null, "type": "securestring" } }, "variables": {}, "resources": [ { "type": "Microsoft.Network/networkSecurityGroups", "apiVersion": "2023-06-01", "name": "[parameters('networkSecurityGroups_az104_06_nsg1_name')]", "location": "[resourceGroup().location]", "properties": { "securityRules": [ { "name": "default-allow-rdp", "id": "[resourceId('Microsoft.Network/networkSecurityGroups/securityRules', parameters('networkSecurityGroups_az104_06_nsg1_name'), 'default-allow-rdp')]", "type": "Microsoft.Network/networkSecurityGroups/securityRules", "properties": { "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "3389", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1000, "direction": "Inbound", "sourcePortRanges": [], "destinationPortRanges": [], "sourceAddressPrefixes": [], "destinationAddressPrefixes": [] } }, { "name": "default-allow-http", "id": "[resourceId('Microsoft.Network/networkSecurityGroups/securityRules', parameters('networkSecurityGroups_az104_06_nsg1_name'), 'default-allow-http')]", "type": "Microsoft.Network/networkSecurityGroups/securityRules", "properties": { "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "80", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1100, "direction": "Inbound", "sourcePortRanges": [], "destinationPortRanges": [], "sourceAddressPrefixes": [], "destinationAddressPrefixes": [] } } ] } }, { "type": "Microsoft.Network/virtualNetworks", "apiVersion": "2023-06-01", "name": "[parameters('virtualNetworks_az104_06_vnet1_name')]", "location": "[resourceGroup().location]", "properties": { "addressSpace": { "addressPrefixes": [ "10.60.0.0/22" ] }, "subnets": [ { "name": "subnet0", "properties": { "addressPrefix": "10.60.0.0/24", "delegations": [], "privateEndpointNetworkPolicies": "Disabled", "privateLinkServiceNetworkPolicies": "Enabled" }, "type": "Microsoft.Network/virtualNetworks/subnets" }, { "name": "subnet1", "properties": { "addressPrefix": "10.60.1.0/24", "delegations": [], "privateEndpointNetworkPolicies": "Disabled", "privateLinkServiceNetworkPolicies": "Enabled" }, "type": "Microsoft.Network/virtualNetworks/subnets" }, { "name": "subnet2", "properties": { "addressPrefix": "10.60.2.0/24", "delegations": [], "privateEndpointNetworkPolicies": "Disabled", "privateLinkServiceNetworkPolicies": "Enabled" }, "type": "Microsoft.Network/virtualNetworks/subnets" } ], "virtualNetworkPeerings": [], "enableDdosProtection": false } }, { "type": "Microsoft.Compute/virtualMachines", "apiVersion": "2023-03-01", "name": "[parameters('virtualMachines_az104_06_vm0_name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic0_name'))]" ], "properties": { "hardwareProfile": { "vmSize": "Standard_D2s_v3" }, "storageProfile": { "imageReference": { "publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2019-Datacenter", "version": "latest" }, "osDisk": { "osType": "Windows", "name": "[concat(parameters('virtualMachines_az104_06_vm0_name'), '_disk1')]", "createOption": "FromImage", "caching": "ReadWrite", "deleteOption": "Detach", "diskSizeGB": 127 }, "dataDisks": [] }, "osProfile": { "computerName": "[parameters('virtualMachines_az104_06_vm0_name')]", "adminUsername": "localadmin", "adminPassword": "[parameters('adminPassword')]", "windowsConfiguration": { "provisionVMAgent": true, "enableAutomaticUpdates": true, "patchSettings": { "patchMode": "AutomaticByOS", "assessmentMode": "ImageDefault" }, "enableVMAgentPlatformUpdates": false }, "secrets": [], "allowExtensionOperations": true }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic0_name'))]", "properties": { "primary": true } } ] } } }, { "type": "Microsoft.Compute/virtualMachines", "apiVersion": "2023-03-01", "name": "[parameters('virtualMachines_az104_06_vm1_name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic1_name'))]" ], "properties": { "hardwareProfile": { "vmSize": "Standard_D2s_v3" }, "storageProfile": { "imageReference": { "publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2019-Datacenter", "version": "latest" }, "osDisk": { "osType": "Windows", "name": "[concat(parameters('virtualMachines_az104_06_vm1_name'), '_disk1')]", "createOption": "FromImage", "caching": "ReadWrite", "deleteOption": "Detach", "diskSizeGB": 127 }, "dataDisks": [] }, "osProfile": { "computerName": "[parameters('virtualMachines_az104_06_vm1_name')]", "adminUsername": "localadmin", "adminPassword": "[parameters('adminPassword')]", "windowsConfiguration": { "provisionVMAgent": true, "enableAutomaticUpdates": true, "patchSettings": { "patchMode": "AutomaticByOS", "assessmentMode": "ImageDefault" }, "enableVMAgentPlatformUpdates": false }, "secrets": [], "allowExtensionOperations": true }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic1_name'))]", "properties": { "primary": true } } ] } } }, { "type": "Microsoft.Compute/virtualMachines", "apiVersion": "2023-03-01", "name": "[parameters('virtualMachines_az104_06_vm2_name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic2_name'))]" ], "properties": { "hardwareProfile": { "vmSize": "Standard_D2s_v3" }, "storageProfile": { "imageReference": { "publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2019-Datacenter", "version": "latest" }, "osDisk": { "osType": "Windows", "name": "[concat(parameters('virtualMachines_az104_06_vm2_name'), '_disk1')]", "createOption": "FromImage", "caching": "ReadWrite", "deleteOption": "Detach" }, "dataDisks": [] }, "osProfile": { "computerName": "[parameters('virtualMachines_az104_06_vm2_name')]", "adminUsername": "localadmin", "adminPassword": "[parameters('adminPassword')]", "windowsConfiguration": { "provisionVMAgent": true, "enableAutomaticUpdates": true, "patchSettings": { "patchMode": "AutomaticByOS", "assessmentMode": "ImageDefault" }, "enableVMAgentPlatformUpdates": false }, "secrets": [], "allowExtensionOperations": true }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic2_name'))]", "properties": { "primary": true } } ] } } }, { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[concat(parameters('virtualMachines_az104_06_vm0_name'), '/customScriptExtension')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Compute/virtualMachines', parameters('virtualMachines_az104_06_vm0_name'))]" ], "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Compute", "type": "CustomScriptExtension", "typeHandlerVersion": "1.7", "settings": { "commandToExecute": "powershell.exe Install-WindowsFeature -name Web-Server -IncludeManagementTools && powershell.exe remove-item 'C:\\inetpub\\wwwroot\\iisstart.htm' && powershell.exe Add-Content -Path 'C:\\inetpub\\wwwroot\\iisstart.htm' -Value $('Hello World from ' + $env:computername)" }, "protectedSettings": {} } }, { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[concat(parameters('virtualMachines_az104_06_vm1_name'), '/customScriptExtension')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Compute/virtualMachines', parameters('virtualMachines_az104_06_vm1_name'))]" ], "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Compute", "type": "CustomScriptExtension", "typeHandlerVersion": "1.7", "settings": { "commandToExecute": "powershell.exe Install-WindowsFeature -name Web-Server -IncludeManagementTools && powershell.exe remove-item 'C:\\inetpub\\wwwroot\\iisstart.htm' && powershell.exe Add-Content -Path 'C:\\inetpub\\wwwroot\\iisstart.htm' -Value $('Hello World from ' + $env:computername) && powershell.exe New-Item -Path 'c:\\inetpub\\wwwroot' -Name 'image' -Itemtype 'Directory' && powershell.exe New-Item -Path 'c:\\inetpub\\wwwroot\\image\\' -Name 'iisstart.htm' -ItemType 'file' && powershell.exe Add-Content -Path 'C:\\inetpub\\wwwroot\\image\\iisstart.htm' -Value $('Image from: ' + $env:computername)" }, "protectedSettings": {} } }, { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2023-03-01", "name": "[concat(parameters('virtualMachines_az104_06_vm2_name'), '/customScriptExtension')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Compute/virtualMachines', parameters('virtualMachines_az104_06_vm2_name'))]" ], "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Compute", "type": "CustomScriptExtension", "typeHandlerVersion": "1.7", "settings": { "commandToExecute": "powershell.exe Install-WindowsFeature -name Web-Server -IncludeManagementTools && powershell.exe remove-item 'C:\\inetpub\\wwwroot\\iisstart.htm' && powershell.exe Add-Content -Path 'C:\\inetpub\\wwwroot\\iisstart.htm' -Value $('Hello World from ' + $env:computername) && powershell.exe New-Item -Path 'c:\\inetpub\\wwwroot' -Name 'video' -Itemtype 'Directory' && powershell.exe New-Item -Path 'c:\\inetpub\\wwwroot\\video\\' -Name 'iisstart.htm' -ItemType 'file' && powershell.exe Add-Content -Path 'C:\\inetpub\\wwwroot\\video\\iisstart.htm' -Value $('Video from: ' + $env:computername)" }, "protectedSettings": {} } }, { "type": "Microsoft.Network/networkInterfaces", "apiVersion": "2023-06-01", "name": "[parameters('networkInterfaces_az104_06_nic0_name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworks_az104_06_vnet1_name'))]", "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_az104_06_nsg1_name'))]" ], "kind": "Regular", "properties": { "ipConfigurations": [ { "name": "ipconfig1", "id": "[concat(resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic0_name')), '/ipConfigurations/ipconfig1')]", "etag": "W/\"2690d608-0b02-47be-a9c9-38f240a8bfbf\"", "type": "Microsoft.Network/networkInterfaces/ipConfigurations", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "10.60.0.4", "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworks_az104_06_vnet1_name'), 'subnet0')]" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [] }, "enableIPForwarding": false, "disableTcpStateTracking": false, "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_az104_06_nsg1_name'))]" }, "nicType": "Standard", "auxiliaryMode": "None", "auxiliarySku": "None" } }, { "type": "Microsoft.Network/networkInterfaces", "apiVersion": "2023-06-01", "name": "[parameters('networkInterfaces_az104_06_nic1_name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworks_az104_06_vnet1_name'))]", "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_az104_06_nsg1_name'))]" ], "kind": "Regular", "properties": { "ipConfigurations": [ { "name": "ipconfig1", "id": "[concat(resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic1_name')), '/ipConfigurations/ipconfig1')]", "etag": "W/\"a65f582b-ab26-4a99-aa7f-f5ff9c7c6756\"", "type": "Microsoft.Network/networkInterfaces/ipConfigurations", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "10.60.1.4", "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworks_az104_06_vnet1_name'), 'subnet1')]" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [] }, "enableIPForwarding": false, "disableTcpStateTracking": false, "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_az104_06_nsg1_name'))]" }, "nicType": "Standard", "auxiliaryMode": "None", "auxiliarySku": "None" } }, { "type": "Microsoft.Network/networkInterfaces", "apiVersion": "2023-06-01", "name": "[parameters('networkInterfaces_az104_06_nic2_name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworks_az104_06_vnet1_name'))]", "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_az104_06_nsg1_name'))]" ], "kind": "Regular", "properties": { "ipConfigurations": [ { "name": "ipconfig1", "id": "[concat(resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_az104_06_nic2_name')), '/ipConfigurations/ipconfig1')]", "etag": "W/\"52827e59-e77e-4722-89a1-e79cee3c4b41\"", "type": "Microsoft.Network/networkInterfaces/ipConfigurations", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "10.62.0.4", "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworks_az104_06_vnet1_name'), 'subnet2')]" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [] }, "enableIPForwarding": false, "disableTcpStateTracking": false, "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_az104_06_nsg1_name'))]" }, "nicType": "Standard", "auxiliaryMode": "None", "auxiliarySku": "None" } } ] }