-
Notifications
You must be signed in to change notification settings - Fork 2
/
AzureVirtualMachineDeploy.json
175 lines (173 loc) · 6.34 KB
/
AzureVirtualMachineDeploy.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
"variables": {
"VmName": "MyVm",
"ResourceGroupName": "ResourceGroupName",
"NicName": "MyNic",
"VirtualNetworkName": "VirtualNetworkName",
"VirtualAddressPrefix": "10.0.0.0/24",
"PublicIP": "MyPublicIPAddress",
"Subnet1Name": "Subnet1Name",
"Subnet1Prefix": "(concat.parameters('Subnet1Prefix'))",
"Subnet2Name": "Subnet2Name",
"Subnet2Prefix": "(concat.parameters('Subnet2Prefix'))",
"StorageAccountName": "StorageAccountName",
"VMSize": "200",
"Location": "(concat.parameters('ResourceGroupLocation'))"
},
"Resources": [
{
"type": "Microsoft.Resources/ResourceGroups",
"apiversion": "2018-05-01",
"name": "(concat.parameters('ResourceGroupName'))",
"location": "(concat.parameters('ResourceGroupLocation'))",
"Comments": "(Resource Group Resource has been created in the Resource Group location specified by the user)",
"tags": "ResourceGroup1"
},
{
"type": "Microsoft.Networks/VirtualNetworks",
"apiversion": "2017-10-01",
"name": "(variables('VirtualNetworkName'))",
"location": "(variables('location'))",
"tags": "VirtualNetwork1",
"comments": "(Virtual Network Resource has been created in the Resource Group Location specified by the user )",
"Properties":{
"AddressSpace": {
"AddressPrefix": [
"(variables(VirtualAddressPrefix))"
]
},
"Subnets": [
{
"type": "subnets",
"apiversion": "2017-10-01",
"name": "(concat.parameters('Subnet1'))",
"location": "(varaibles('Location'))",
"tags": "Subnet1",
"Comments": "(Subnet1 Resource have been created in the Virtual Network with the address space specified by user)",
"DependsOn":
"(concat.parameters('VirtualNetworkName'))",
"Properties": {
"addressPefixes": [
"(variables('Subnet1Prefix'))"
]
}
},
{
"type": "subnets",
"apiversion": "2017-10-01",
"name": "(concat.parameters('Subnet2))",
"location": "(variables('Location'))",
"tags": "Subnet2",
"Comments": "(Subnet 2 Resource have been created in the VNET with the address space specified by the user)",
"DependsOn":
"(concat.parameters('VirtualNetworkName'))",
"properties":{
"AddressPrefix": "(variables('Subnet2Prefix')"
}
}
]
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiversion": "2017-10-01",
"name": "(concat.parameters('StorageAccountName'))",
"location": "(varaibles('Location'))",
"comments": "(Storage Account Resource has been created in the Resource group Location)",
"tags": "StorageAccount",
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"Properties": {
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiversion": "2017-10-01",
"name": "(variables('PublicIPAddress'))",
"Comments": "(Public Ip address resource has been created in the Resource group Location)",
"location": "(variables('Location'))",
"tags": "PublicIPAddress",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"DnsSettings": {
"domainNameLablel": "[concat.parameters('DNSLabel')]"
}
}
},
{
"type": "Microsoft.Networks/NetworkInterface",
"apiversion": "2017-10-01",
"name": "(concat.parameters('NetworkInterface'))",
"location": "(varaibles('Location'))",
"tags": "NetworkInterface1",
"comments": "(Network Interface resource has been specified in the resource group Location)",
"DependsOn":
"[concat('Microsoft.Network/publicIPAddresses/', variables('PublicIPAddress'))]",
"Properties":{
"IpConfigurations": {
"IPAddressAllocation": "Dynamic"
}
}
},
{
"type": "Microsoft.Compute/VirtualMachine",
"apiversion": "2017-10-01",
"name": "(variables('VmName'), CopyIndex())",
"location": "(variables('Location'))",
"tags": "VirtualMachine1",
"Copy": {
"Name": "(VirtualMachineInstances, CopyIndex())",
"count": "(concat.parameters('VMCount'))"
},
"Comments": "(Virtual Machine resource has been created with the properties required in the Resource Location of the Resource Group Location)",
"DependsOn":
[
"(concat.parameters('Microsoft.Networks/NetworkInterfaces', varaibles('NicName')))",
"(concat.parameters('Microsoft.Networks/VirtualNetworks',variables('VirtualNetworkName'))"
],
"Properties":
{
"HardwareProfile": {
"Vmsize": "(concat.parameters('VMSize'),CopyIndex())"
},
"OsProfile":{
"ComputerName": "(variables('VmName'),CopyIndex())",
"AdminUserName": "(concat.parameters('AdminUserName'), CopyIndex())" ,
"AdminPassword": "(concat.parameters('AdminPassword'))"
},
"StorageProfile":
{
"ImageRefernce":
{
"publisher":"Windows Server 2019 Datacenter",
"offer":"WindowsVersion",
"sku":"Standard D2s V3"
}
},
"OSDisk":
{
"OS Disk type" : "Premimum SSD"
},
"DataDisk":
{
"size": " 1024 GB",
"Name": "(concat.parameters('VmName'))",
"lun": "0",
"Disk type": "Premimum SSD"
},
"NetworkProfile":
{"(concat.parameters('Microsoft.Networks/NetworksInterfaces', variables('MyNic')))" },
"DiagnosticsProfile": {
"BootDiagnostics": "(Refernce(ResourceID('Microsoft.Storage/storageAccount', concat.parameters('StorageAccountName'))"
}
}
}
],
"Outputs": {
"type": "string",
"Value": "(concat.parameters('DNSLabel'),variables('VmName'))",
"Comments": "(Output with the VM Name will be the Output)"
}
}