source code
source code
{
2. "$schema": "https://schema.management.azure.com/schemas/2019-04-
01/deploymentTemplate.json#",
3. "contentVersion": "1.0.0.0",
4. "resources": [
5. {
6. "type": "Microsoft.Network/virtualNetworks",
7. "apiVersion": "2020-11-01",
8. "name": "HQ-VNet",
9. "location": "East US",
10. "properties": {
11. "addressSpace": {
12. "addressPrefixes": ["10.0.0.0/16"]
13. },
14. "subnets": [
15. {
a. "name": "HQ-Subnet",
b. "properties": {
c. "addressPrefix": "10.0.0.0/24"
d. }
16. }
17. ]
18. }
19. },
20. {
21. "type": "Microsoft.Network/virtualNetworks",
22. "apiVersion": "2020-11-01",
23. "name": "BO-VNet",
24. "location": "Southeast Asia",
25. "properties": {
26. "addressSpace": {
27. "addressPrefixes": ["192.168.0.0/16"]
28. },
29. "subnets": [
30. {
a. "name": "BO-Subnet",
b. "properties": {
c. "addressPrefix": "192.168.0.0/24"
d. }
31. }
32. ]
33. }
34. },
35. {
36. "type": "Microsoft.Compute/virtualMachines",
37. "apiVersion": "2021-11-01",
38. "name": "HQ-TestVM",
39. "location": "East US",
40. "properties": {
41. "hardwareProfile": {
42. "vmSize": "Standard_DS1_v2"
43. },
44. "storageProfile": {
45. "imageReference": {
a. "publisher": "MicrosoftWindowsServer",
b. "offer": "WindowsServer",
c. "sku": "2019-Datacenter-smalldisk",
d. "version": "latest"
46. }
47. },
48. "osProfile": {
49. "computerName": "HQ-TestVM",
50. "adminUsername": "azureuser",
51. "adminPassword": "Password1234!"
52. },
53. "networkProfile": {
54. "networkInterfaces": [
a. {
b. "id": "[resourceId('Microsoft.Network/networkInterfaces', 'HQ-TestVM-
NIC')]"
c. }
55. ]
56. }
57. },
58. "dependsOn": ["[resourceId('Microsoft.Network/virtualNetworks', 'HQ-VNet')]"]
59. },
60. {
61. "type": "Microsoft.Compute/virtualMachines",
62. "apiVersion": "2021-11-01",
63. "name": "BO-TestVM",
64. "location": "Southeast Asia",
65. "properties": {
66. "hardwareProfile": {
67. "vmSize": "Standard_DS1_v2"
68. },
69. "storageProfile": {
70. "imageReference": {
a. "publisher": "MicrosoftWindowsServer",
b. "offer": "WindowsServer",
c. "sku": "2019-Datacenter-smalldisk",
d. "version": "latest"
71. }
72. },
73. "osProfile": {
74. "computerName": "BO-TestVM",
75. "adminUsername": "azureuser",
76. "adminPassword": "Password1234!"
77. },
78. "networkProfile": {
79. "networkInterfaces": [
a. {
b. "id": "[resourceId('Microsoft.Network/networkInterfaces', 'BO-TestVM-
NIC')]"
c. }
80. ]
81. }
82. },
83. "dependsOn": ["[resourceId('Microsoft.Network/virtualNetworks', 'BO-VNet')]"]
84. },
85. {
86. "type": "Microsoft.Network/virtualNetworkPeerings",
87. "apiVersion": "2020-11-01",
88. "name": "HQ-VNet/BO-VNet-Peering",
89. "properties": {
90. "allowVirtualNetworkAccess": true,
91. "allowForwardedTraffic": true,
92. "remoteVirtualNetwork": {
93. "id": "[resourceId('Microsoft.Network/virtualNetworks', 'BO-VNet')]"
94. }
95. },
96. "dependsOn": ["[resourceId('Microsoft.Network/virtualNetworks', 'HQ-VNet')]"]
97. },
98. {
99. "type": "Microsoft.Network/virtualNetworkPeerings",
100. "apiVersion": "2020-11-01",
101. "name": "BO-VNet/HQ-VNet-Peering",
102. "properties": {
103. "allowVirtualNetworkAccess": true,
104. "allowForwardedTraffic": true,
105. "remoteVirtualNetwork": {
106. "id": "[resourceId('Microsoft.Network/virtualNetworks', 'HQ-VNet')]"
107. }
108. },
109. "dependsOn": ["[resourceId('Microsoft.Network/virtualNetworks', 'BO-
VNet')]"]
110. }
111. ]
112. }