@@ -7,7 +7,7 @@ ms.subservice: azure-mqtt-broker
7
7
ms.topic : how-to
8
8
ms.custom :
9
9
- ignite-2023
10
- ms.date : 10/30 /2024
10
+ ms.date : 11/02 /2024
11
11
12
12
# CustomerIntent: As an operator, I want to configure authorization so that I have secure MQTT broker communications.
13
13
ms.service : azure-iot-operations
@@ -50,18 +50,26 @@ To edit the default endpoint, create a Bicep `.bicep` file with the following co
50
50
``` bicep
51
51
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
52
52
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
53
+ param policyName string = '<POLICY_NAME>'
53
54
54
55
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
55
56
name: aioInstanceName
56
57
}
58
+
57
59
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
58
60
name: customLocationName
59
61
}
60
- resource BrokerAuthorization 'Microsoft.IoTOperations/instances/brokerAuthorization@2024-09-15-preview' = {
61
- parent: aioInstanceName
62
- name: endpointName
62
+
63
+ resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
64
+ parent: aioInstance
65
+ name: 'default'
66
+ }
67
+
68
+ resource brokerAuthorization 'Microsoft.IoTOperations/instances/brokers/authorizations@2024-09-15-preview' = {
69
+ parent: defaultBroker
70
+ name: policyName
63
71
extendedLocation: {
64
- name: customLocationName
72
+ name: customLocation.id
65
73
type: 'CustomLocation'
66
74
}
67
75
properties: {
@@ -110,7 +118,7 @@ resource BrokerAuthorization 'Microsoft.IoTOperations/instances/brokerAuthorizat
110
118
Deploy the Bicep file using Azure CLI.
111
119
112
120
``` azurecli
113
- az stack group create --name MyDeploymentStack -- resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep --dm None --aou deleteResources --yes
121
+ az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
114
122
```
115
123
116
124
# [ Kubernetes] ( #tab/kubernetes )
@@ -204,18 +212,26 @@ In the **Broker authorization details** for your authorization policy, use the f
204
212
` ` ` bicep
205
213
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
206
214
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
215
+ param policyName string = '<POLICY_NAME>'
207
216
208
217
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
209
218
name: aioInstanceName
210
219
}
220
+
211
221
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
212
222
name: customLocationName
213
223
}
214
- resource BrokerAuthorization 'Microsoft.IoTOperations/instances/brokerAuthorization@2024-09-15-preview' = {
215
- parent: aioInstanceName
216
- name: endpointName
224
+
225
+ resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
226
+ parent: aioInstance
227
+ name: 'default'
228
+ }
229
+
230
+ resource brokerAuthorization 'Microsoft.IoTOperations/instances/brokers/authorizations@2024-09-15-preview' = {
231
+ parent: defaultBroker
232
+ name: policyName
217
233
extendedLocation: {
218
- name: customLocationName
234
+ name: customLocation.id
219
235
type: 'CustomLocation'
220
236
}
221
237
properties: {
@@ -253,7 +269,13 @@ resource BrokerAuthorization 'Microsoft.IoTOperations/instances/brokerAuthorizat
253
269
}
254
270
}
255
271
` ` `
256
-
272
+
273
+ Deploy the Bicep file using Azure CLI.
274
+
275
+ ` ` ` azurecli
276
+ az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
277
+ ` ` `
278
+
257
279
# [Kubernetes](#tab/kubernetes)
258
280
259
281
` ` ` yaml
@@ -353,23 +375,30 @@ In the **Broker authorization details** for your authorization policy, use the f
353
375
` ` ` bicep
354
376
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
355
377
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
378
+ param policyName string = '<POLICY_NAME>'
356
379
357
380
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
358
381
name: aioInstanceName
359
382
}
383
+
360
384
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
361
385
name: customLocationName
362
386
}
363
- resource BrokerAuthorization 'Microsoft.IoTOperations/instances/brokerAuthorization@2024-09-15-preview' = {
364
- parent: aioInstanceName
365
- name: endpointName
387
+
388
+ resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
389
+ parent: aioInstance
390
+ name: 'default'
391
+ }
392
+
393
+ resource brokerAuthorization 'Microsoft.IoTOperations/instances/brokers/authorizations@2024-09-15-preview' = {
394
+ parent: defaultBroker
395
+ name: policyName
366
396
extendedLocation: {
367
- name: customLocationName
397
+ name: customLocation.id
368
398
type: 'CustomLocation'
369
399
}
370
400
properties: {
371
401
authorizationPolicies: {
372
- enableCache: false
373
402
rules: [
374
403
{
375
404
principals: {
@@ -404,6 +433,12 @@ resource BrokerAuthorization 'Microsoft.IoTOperations/instances/brokerAuthorizat
404
433
405
434
` ` `
406
435
436
+ Deploy the Bicep file using Azure CLI.
437
+
438
+ ` ` ` azurecli
439
+ az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
440
+ ` ` `
441
+
407
442
# [Kubernetes](#tab/kubernetes)
408
443
409
444
` ` ` yaml
0 commit comments