|
2 | 2 | "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
|
3 | 3 | "contentVersion": "1.0.0.0",
|
4 | 4 | "parameters": {
|
5 |
| - "AlgoServerName": { |
6 |
| - "type": "string" |
7 |
| - }, |
8 | 5 | "sshKeyData": {
|
9 | 6 | "type": "string"
|
10 | 7 | },
|
11 |
| - "location": { |
12 |
| - "type": "string" |
13 |
| - }, |
14 | 8 | "WireGuardPort": {
|
15 | 9 | "type": "int"
|
16 | 10 | },
|
|
22 | 16 | }
|
23 | 17 | },
|
24 | 18 | "variables": {
|
25 |
| - "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', parameters('AlgoServerName'))]", |
26 |
| - "subnet1Ref": "[concat(variables('vnetID'),'/subnets/', parameters('AlgoServerName'))]" |
| 19 | + "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', resourceGroup().name)]", |
| 20 | + "subnet1Ref": "[concat(variables('vnetID'),'/subnets/', resourceGroup().name)]" |
27 | 21 | },
|
28 | 22 | "resources": [
|
29 | 23 | {
|
30 | 24 | "apiVersion": "2015-06-15",
|
31 | 25 | "type": "Microsoft.Network/networkSecurityGroups",
|
32 |
| - "name": "[parameters('AlgoServerName')]", |
33 |
| - "location": "[parameters('location')]", |
| 26 | + "name": "[resourceGroup().name]", |
| 27 | + "location": "[resourceGroup().location]", |
34 | 28 | "properties": {
|
35 | 29 | "securityRules": [
|
36 | 30 | {
|
|
95 | 89 | {
|
96 | 90 | "apiVersion": "2015-06-15",
|
97 | 91 | "type": "Microsoft.Network/publicIPAddresses",
|
98 |
| - "name": "[parameters('AlgoServerName')]", |
99 |
| - "location": "[parameters('location')]", |
| 92 | + "name": "[resourceGroup().name]", |
| 93 | + "location": "[resourceGroup().location]", |
100 | 94 | "properties": {
|
101 | 95 | "publicIPAllocationMethod": "Static"
|
102 | 96 | }
|
103 | 97 | },
|
104 | 98 | {
|
105 | 99 | "apiVersion": "2015-06-15",
|
106 | 100 | "type": "Microsoft.Network/virtualNetworks",
|
107 |
| - "name": "[parameters('AlgoServerName')]", |
108 |
| - "location": "[parameters('location')]", |
| 101 | + "name": "[resourceGroup().name]", |
| 102 | + "location": "[resourceGroup().location]", |
109 | 103 | "properties": {
|
110 | 104 | "addressSpace": {
|
111 | 105 | "addressPrefixes": [
|
|
114 | 108 | },
|
115 | 109 | "subnets": [
|
116 | 110 | {
|
117 |
| - "name": "[parameters('AlgoServerName')]", |
| 111 | + "name": "[resourceGroup().name]", |
118 | 112 | "properties": {
|
119 | 113 | "addressPrefix": "10.10.0.0/24"
|
120 | 114 | }
|
|
125 | 119 | {
|
126 | 120 | "apiVersion": "2015-06-15",
|
127 | 121 | "type": "Microsoft.Network/networkInterfaces",
|
128 |
| - "name": "[parameters('AlgoServerName')]", |
129 |
| - "location": "[parameters('location')]", |
| 122 | + "name": "[resourceGroup().name]", |
| 123 | + "location": "[resourceGroup().location]", |
130 | 124 | "dependsOn": [
|
131 |
| - "[concat('Microsoft.Network/networkSecurityGroups/', parameters('AlgoServerName'))]", |
132 |
| - "[concat('Microsoft.Network/publicIPAddresses/', parameters('AlgoServerName'))]", |
133 |
| - "[concat('Microsoft.Network/virtualNetworks/', parameters('AlgoServerName'))]" |
| 125 | + "[concat('Microsoft.Network/networkSecurityGroups/', resourceGroup().name)]", |
| 126 | + "[concat('Microsoft.Network/publicIPAddresses/', resourceGroup().name)]", |
| 127 | + "[concat('Microsoft.Network/virtualNetworks/', resourceGroup().name)]" |
134 | 128 | ],
|
135 | 129 | "properties": {
|
136 | 130 | "networkSecurityGroup": {
|
137 |
| - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('AlgoServerName'))]" |
| 131 | + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', resourceGroup().name)]" |
138 | 132 | },
|
139 | 133 | "ipConfigurations": [
|
140 | 134 | {
|
141 | 135 | "name": "ipconfig1",
|
142 | 136 | "properties": {
|
143 | 137 | "privateIPAllocationMethod": "Dynamic",
|
144 | 138 | "publicIPAddress": {
|
145 |
| - "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('AlgoServerName'))]" |
| 139 | + "id": "[resourceId('Microsoft.Network/publicIPAddresses', resourceGroup().name)]" |
146 | 140 | },
|
147 | 141 | "subnet": {
|
148 | 142 | "id": "[variables('subnet1Ref')]"
|
|
155 | 149 | {
|
156 | 150 | "apiVersion": "2016-04-30-preview",
|
157 | 151 | "type": "Microsoft.Compute/virtualMachines",
|
158 |
| - "name": "[parameters('AlgoServerName')]", |
159 |
| - "location": "[parameters('location')]", |
| 152 | + "name": "[resourceGroup().name]", |
| 153 | + "location": "[resourceGroup().location]", |
160 | 154 | "dependsOn": [
|
161 |
| - "[concat('Microsoft.Network/networkInterfaces/', parameters('AlgoServerName'))]" |
| 155 | + "[concat('Microsoft.Network/networkInterfaces/', resourceGroup().name)]" |
162 | 156 | ],
|
163 | 157 | "properties": {
|
164 | 158 | "hardwareProfile": {
|
165 | 159 | "vmSize": "[parameters('vmSize')]"
|
166 | 160 | },
|
167 | 161 | "osProfile": {
|
168 |
| - "computerName": "[parameters('AlgoServerName')]", |
| 162 | + "computerName": "[resourceGroup().name]", |
169 | 163 | "adminUsername": "ubuntu",
|
170 | 164 | "linuxConfiguration": {
|
171 | 165 | "disablePasswordAuthentication": true,
|
|
193 | 187 | "networkProfile": {
|
194 | 188 | "networkInterfaces": [
|
195 | 189 | {
|
196 |
| - "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('AlgoServerName'))]" |
| 190 | + "id": "[resourceId('Microsoft.Network/networkInterfaces', resourceGroup().name)]" |
197 | 191 | }
|
198 | 192 | ]
|
199 | 193 | }
|
|
203 | 197 | "outputs": {
|
204 | 198 | "publicIPAddresses": {
|
205 | 199 | "type": "string",
|
206 |
| - "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',parameters('AlgoServerName')),providers('Microsoft.Network', 'publicIPAddresses').apiVersions[0]).ipAddress]", |
| 200 | + "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',resourceGroup().name),providers('Microsoft.Network', 'publicIPAddresses').apiVersions[0]).ipAddress]", |
207 | 201 | }
|
208 | 202 | }
|
209 | 203 | }
|
0 commit comments