6
6
"type" : " string" ,
7
7
"defaultValue" : " autonotebook" ,
8
8
"metadata" : {
9
- "description" : " The name of you Virtual Machine used to execute notebooks."
9
+ "description" : " The name of your Virtual Machine used to execute notebooks."
10
10
}
11
11
},
12
12
"adminUsername" : {
17
17
}
18
18
},
19
19
"authenticationType" : {
20
- "type" : " string" ,
21
- "defaultValue" : " sshPublicKey" ,
20
+ "type" : " string" ,
21
+ "defaultValue" : " sshPublicKey" ,
22
22
"allowedValues" : [
23
23
" sshPublicKey" ,
24
24
" password"
32
32
"metadata" : {
33
33
"description" : " SSH Key or password for the Virtual Machine. SSH key is recommended."
34
34
}
35
- },
36
- "dnsLabelPrefix" : {
37
- "type" : " string" ,
38
- "defaultValue" : " [toLower(concat('autonotebooks-', uniqueString(resourceGroup().id)))]" ,
39
- "metadata" : {
40
- "description" : " Unique DNS Name for the Public IP used to access the Virtual Machine."
41
- }
42
- },
35
+ },
43
36
"ubuntuOSVersion" : {
44
37
"type" : " string" ,
45
38
"defaultValue" : " 18.04-LTS" ,
52
45
"metadata" : {
53
46
"description" : " The Ubuntu version for the VM. This will pick a fully patched image of this given Ubuntu version."
54
47
}
55
- },
56
- "location" : {
57
- "type" : " string" ,
58
- "defaultValue" : " [resourceGroup().location]" ,
59
- "metadata" : {
60
- "description" : " Location for all resources."
61
- }
62
- },
48
+ },
63
49
"VmSize" : {
64
50
"type" : " string" ,
65
51
"defaultValue" : " Standard_B2s" ,
66
52
"metadata" : {
67
53
"description" : " The size of the VM"
68
54
}
69
- },
70
- "virtualNetworkName" : {
71
- "type" : " string" ,
72
- "defaultValue" : " [concat(parameters('vmName'),'-VNET')]" ,
73
- "metadata" : {
74
- "description" : " Name of the VNET"
75
- }
76
- },
77
- "subnetName" : {
78
- "type" : " string" ,
79
- "defaultValue" : " [concat(parameters('vmName'),'-subnet')]" ,
80
- "metadata" : {
81
- "description" : " Name of the subnet in the virtual network"
82
- }
83
- },
84
- "networkSecurityGroupName" : {
85
- "type" : " string" ,
86
- "defaultValue" : " [concat(parameters('vmName'),'-NSG')]" ,
87
- "metadata" : {
88
- "description" : " Name of the Network Security Group"
89
- }
90
- },
55
+ },
91
56
"SentinelRG" :{
92
- "type" : " string" ,
93
- "defaultValue" : " [resourceGroup().id]" ,
57
+ "type" : " string" ,
94
58
"metadata" : {
95
59
"description" : " The name of the Resource Group the Sentinel Workspace is in - change if RG is different from RG this VM is being deployed in"
96
60
}
97
61
},
98
62
"SentinelSub" :{
99
- "type" : " string" ,
100
- "defaultValue" : " [subscription().subscriptionId]" ,
63
+ "type" : " string" ,
101
64
"metadata" : {
102
65
"description" : " The ID of the subscription the Sentinel Workspace is in - change if RG is different from RG this VM is being deployed in"
103
66
}
104
67
},
105
68
"AzureMLSub" :{
106
- "type" : " string" ,
107
- "defaultValue" : " [subscription().subscriptionId]" ,
69
+ "type" : " string" ,
108
70
"metadata" : {
109
71
"description" : " The ID of the subscription the Azure ML Workspace is in - change if RG is different from RG this VM is being deployed in"
110
72
}
111
73
},
112
74
"AzureMLRG" :{
113
- "type" : " string" ,
114
- "defaultValue" : " [resourceGroup().id]" ,
75
+ "type" : " string" ,
115
76
"metadata" : {
116
77
"description" : " The name of the Resource Group the Azure ML Workspace is in - change if RG is different from RG this VM is being deployed in"
117
78
}
118
79
},
119
80
"builtInRoleType1" : {
120
81
"type" : " string" ,
121
82
"defaultValue" : " Azure Sentinel Responder"
122
- },
123
- "rbacGuid1" : {
124
- "type" : " string" ,
125
- "defaultValue" : " [newGuid()]"
126
- },
83
+ },
127
84
"builtInRoleType2" : {
128
85
"type" : " string" ,
129
86
"defaultValue" : " Reader"
130
- },
131
- "rbacGuid2" : {
132
- "type" : " string" ,
133
- "defaultValue" : " [newGuid()]"
134
- }
87
+ }
135
88
},
136
89
"variables" : {
137
90
"rbac1Scope" : " [concat('/subscriptions/', parameters('SentinelSub'), '/resourceGroups/', parameters('SentinelRG'))]" ,
138
91
"rbac2Scope" : " [concat('/subscriptions/', parameters('AzureMLSub'), '/resourceGroups/', parameters('AzureMLRG'))]" ,
92
+ "virtualNetworkName" :" [concat(parameters('vmName'),'-VNET')]" ,
93
+ "subnetName" :" [concat(parameters('vmName'),'-subnet')]" ,
139
94
"vmResourceId" : " [resourceId('Microsoft.Compute/virtualMachines/', parameters('vmName'))]" ,
140
95
"Reader" : " [concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')]" ,
141
96
"Azure Sentinel Responder" : " [concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '3e150937-b8fe-4cfb-8069-0eaf05ecd056')]" ,
142
97
"publicIpAddressName" : " [concat(parameters('vmName'), 'PublicIP' )]" ,
143
98
"networkInterfaceName" : " [concat(parameters('vmName'),'NetInt')]" ,
144
- "subnetRef" : " [resourceId('Microsoft.Network/virtualNetworks/subnets', parameters ('virtualNetworkName'), parameters ('subnetName'))]" ,
99
+ "subnetRef" : " [resourceId('Microsoft.Network/virtualNetworks/subnets', variables ('virtualNetworkName'), variables ('subnetName'))]" ,
145
100
"osDiskType" : " Standard_LRS" ,
146
101
"subnetAddressPrefix" : " 10.1.0.0/24" ,
147
102
"addressPrefix" : " 10.1.0.0/16" ,
103
+ "dnsLabelPrefix" : " [toLower(concat('autonotebooks-', uniqueString(resourceGroup().id)))]" ,
104
+ "networkSecurityGroupName" :" [concat(parameters('vmName'),'-NSG')]" ,
105
+ "rbacGuid1" :" [guid(subscription().subscriptionId, deployment().name)]" ,
106
+ "rbacGuid2" :" [guid(resourceGroup().id, deployment().name)]" ,
148
107
"linuxConfiguration" : {
149
108
"disablePasswordAuthentication" : true ,
150
109
"ssh" : {
162
121
"type" : " Microsoft.Network/networkInterfaces" ,
163
122
"apiVersion" : " 2020-06-01" ,
164
123
"name" : " [variables('networkInterfaceName')]" ,
165
- "location" : " [parameters('location') ]" ,
124
+ "location" : " [resourceGroup().location ]" ,
166
125
"dependsOn" : [
167
- " [resourceId('Microsoft.Network/networkSecurityGroups/', parameters ('networkSecurityGroupName'))]" ,
168
- " [resourceId('Microsoft.Network/virtualNetworks/', parameters ('virtualNetworkName'))]" ,
126
+ " [resourceId('Microsoft.Network/networkSecurityGroups/', variables ('networkSecurityGroupName'))]" ,
127
+ " [resourceId('Microsoft.Network/virtualNetworks/', variables ('virtualNetworkName'))]" ,
169
128
" [resourceId('Microsoft.Network/publicIpAddresses/', variables('publicIpAddressName'))]"
170
129
],
171
130
"properties" : {
184
143
}
185
144
],
186
145
"networkSecurityGroup" : {
187
- "id" : " [resourceId('Microsoft.Network/networkSecurityGroups',parameters ('networkSecurityGroupName'))]"
146
+ "id" : " [resourceId('Microsoft.Network/networkSecurityGroups',variables ('networkSecurityGroupName'))]"
188
147
}
189
148
}
190
149
},
191
150
{
192
151
"type" : " Microsoft.Network/networkSecurityGroups" ,
193
152
"apiVersion" : " 2020-06-01" ,
194
- "name" : " [parameters ('networkSecurityGroupName')]" ,
195
- "location" : " [parameters('location') ]" ,
153
+ "name" : " [variables ('networkSecurityGroupName')]" ,
154
+ "location" : " [resourceGroup().location ]" ,
196
155
"properties" : {
197
156
"securityRules" : [
198
157
{
214
173
{
215
174
"type" : " Microsoft.Network/virtualNetworks" ,
216
175
"apiVersion" : " 2020-06-01" ,
217
- "name" : " [parameters ('virtualNetworkName')]" ,
218
- "location" : " [parameters('location') ]" ,
176
+ "name" : " [variables ('virtualNetworkName')]" ,
177
+ "location" : " [resourceGroup().location ]" ,
219
178
"properties" : {
220
179
"addressSpace" : {
221
180
"addressPrefixes" : [
224
183
},
225
184
"subnets" : [
226
185
{
227
- "name" : " [parameters ('subnetName')]" ,
186
+ "name" : " [variables ('subnetName')]" ,
228
187
"properties" : {
229
188
"addressPrefix" : " [variables('subnetAddressPrefix')]" ,
230
189
"privateEndpointNetworkPolicies" : " Enabled" ,
238
197
"type" : " Microsoft.Network/publicIpAddresses" ,
239
198
"apiVersion" : " 2020-06-01" ,
240
199
"name" : " [variables('publicIpAddressName')]" ,
241
- "location" : " [parameters('location') ]" ,
200
+ "location" : " [resourceGroup().location ]" ,
242
201
"sku" : {
243
202
"name" : " Basic" ,
244
203
"tier" : " Regional"
247
206
"publicIpAllocationMethod" : " Dynamic" ,
248
207
"publicIPAddressVersion" : " IPv4" ,
249
208
"dnsSettings" : {
250
- "domainNameLabel" : " [parameters ('dnsLabelPrefix')]"
209
+ "domainNameLabel" : " [variables ('dnsLabelPrefix')]"
251
210
},
252
211
"idleTimeoutInMinutes" : 4
253
212
}
256
215
"type" : " Microsoft.Compute/virtualMachines" ,
257
216
"apiVersion" : " 2020-06-01" ,
258
217
"name" : " [parameters('vmName')]" ,
259
- "location" : " [parameters('location') ]" ,
218
+ "location" : " [resourceGroup().location ]" ,
260
219
"identity" : {
261
220
"type" : " SystemAssigned"
262
221
},
309
268
"contentVersion" : " 1.0.0.0" ,
310
269
"resources" : [
311
270
{
312
- "name" : " [guid(parameters ('rbacGuid1'))]" ,
271
+ "name" : " [guid(variables ('rbacGuid1'))]" ,
313
272
"type" : " Microsoft.Authorization/roleAssignments" ,
314
273
"apiVersion" : " 2017-09-01" ,
315
274
"properties" : {
335
294
"contentVersion" : " 1.0.0.0" ,
336
295
"resources" : [
337
296
{
338
- "name" : " [guid(parameters ('rbacGuid2'))]" ,
297
+ "name" : " [guid(variables ('rbacGuid2'))]" ,
339
298
"type" : " Microsoft.Authorization/roleAssignments" ,
340
299
"apiVersion" : " 2017-09-01" ,
341
300
"properties" : {
361
320
"sshCommand" : {
362
321
"type" : " string" ,
363
322
"value" : " [concat('ssh ', parameters('adminUsername'), '@', reference(variables('publicIPAddressName')).dnsSettings.fqdn)]"
364
- }
323
+ }
365
324
}
366
- }
325
+ }
0 commit comments