Skip to content

Commit 8bc721c

Browse files
committed
Fix bicep
1 parent 345f1fb commit 8bc721c

File tree

1 file changed

+67
-20
lines changed

1 file changed

+67
-20
lines changed

articles/iot-operations/manage-mqtt-broker/howto-configure-authentication.md

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,21 @@ param customLocationName string = '<CUSTOM_LOCATION_NAME>'
5757
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
5858
name: aioInstanceName
5959
}
60+
6061
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
6162
name: customLocationName
6263
}
63-
resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentication@2024-09-15-preview' = {
64-
parent: aioInstanceName
65-
name: endpointName
64+
65+
resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
66+
parent: aioInstance
67+
name: 'default'
68+
}
69+
70+
resource defaultBrokerAuthentication 'Microsoft.IoTOperations/instances/brokers/authentications@2024-09-15-preview' = {
71+
parent: defaultBroker
72+
name: 'default'
6673
extendedLocation: {
67-
name: customLocationName
74+
name: customLocation.id
6875
type: 'CustomLocation'
6976
}
7077
properties: {
@@ -86,7 +93,7 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
8693
Deploy the Bicep file using Azure CLI.
8794

8895
```azurecli
89-
az stack group create --name MyDeploymentStack --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep --dm None --aou deleteResources --yes
96+
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
9097
```
9198

9299
# [Kubernetes](#tab/kubernetes)
@@ -184,18 +191,26 @@ To add an authentication method to a policy:
184191
```bicep
185192
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
186193
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
194+
param policyName string = '<POLICY_NAME>'
187195
188196
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
189197
name: aioInstanceName
190198
}
199+
191200
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
192201
name: customLocationName
193202
}
194-
resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentication@2024-09-15-preview' = {
195-
parent: aioInstanceName
196-
name: endpointName
203+
204+
resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
205+
parent: aioInstance
206+
name: 'default'
207+
}
208+
209+
resource myBrokerAuthentication 'Microsoft.IoTOperations/instances/brokers/authentications@2024-09-15-preview' = {
210+
parent: defaultBroker
211+
name: policyName
197212
extendedLocation: {
198-
name: customLocationName
213+
name: customLocation.id
199214
type: 'CustomLocation'
200215
}
201216
properties: {
@@ -228,7 +243,6 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
228243
method: 'X509'
229244
x509Settings: {
230245
authorizationAttributes: {
231-
trustedClientCaCert: 'client-ca'
232246
root: {
233247
attributes: {
234248
organization: 'contoso'
@@ -242,7 +256,7 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
242256
}
243257
subject: 'CN = Contoso Intermediate CA'
244258
}
245-
smart-fan: {
259+
smartfan: {
246260
attributes: {
247261
building: '17'
248262
}
@@ -257,6 +271,12 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
257271
258272
```
259273

274+
Deploy the Bicep file using Azure CLI.
275+
276+
```azurecli
277+
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
278+
```
279+
260280
# [Kubernetes](#tab/kubernetes)
261281

262282
Modify the *BrokerAuthentication* resource for a authentication policy by adding new methods to the `authenticationMethods` section. The following example shows multiple authentication methods for a *BrokerAuthentication* resource:
@@ -363,18 +383,26 @@ X.509 attributes can be specified in the *BrokerAuthentication* resource, and th
363383
```bicep
364384
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
365385
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
386+
param policyName string = '<POLICY_NAME>'
366387
367388
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
368389
name: aioInstanceName
369390
}
391+
370392
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
371393
name: customLocationName
372394
}
373-
resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentication@2024-09-15-preview' = {
374-
parent: aioInstanceName
375-
name: endpointName
395+
396+
resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
397+
parent: aioInstance
398+
name: 'default'
399+
}
400+
401+
resource myBrokerAuthentication 'Microsoft.IoTOperations/instances/brokers/authentications@2024-09-15-preview' = {
402+
parent: defaultBroker
403+
name: policyName
376404
extendedLocation: {
377-
name: customLocationName
405+
name: customLocation.id
378406
type: 'CustomLocation'
379407
}
380408
properties: {
@@ -396,7 +424,7 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
396424
foo: 'bar'
397425
}
398426
}
399-
smart-fan: {
427+
smartfan: {
400428
subject: 'CN = smart-fan'
401429
attributes: {
402430
building: '17'
@@ -411,6 +439,12 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
411439
412440
```
413441

442+
Deploy the Bicep file using Azure CLI.
443+
444+
```azurecli
445+
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
446+
```
447+
414448
# [Kubernetes](#tab/kubernetes)
415449

416450
```yaml
@@ -526,18 +560,26 @@ Modify the `authenticationMethods` setting in a *BrokerAuthentication* resource
526560
```bicep
527561
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
528562
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
563+
param policyName string = '<POLICY_NAME>'
529564
530565
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
531566
name: aioInstanceName
532567
}
568+
533569
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
534570
name: customLocationName
535571
}
536-
resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentication@2024-09-15-preview' = {
537-
parent: aioInstanceName
538-
name: endpointName
572+
573+
resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
574+
parent: aioInstance
575+
name: 'default'
576+
}
577+
578+
resource myBrokerAuthentication 'Microsoft.IoTOperations/instances/brokers/authentications@2024-09-15-preview' = {
579+
parent: defaultBroker
580+
name: policyName
539581
extendedLocation: {
540-
name: customLocationName
582+
name: customLocation.id
541583
type: 'CustomLocation'
542584
}
543585
properties: {
@@ -554,7 +596,12 @@ resource BrokerAuthentication 'Microsoft.IoTOperations/instances/brokerAuthentic
554596
]
555597
}
556598
}
599+
```
557600

601+
Deploy the Bicep file using Azure CLI.
602+
603+
```azurecli
604+
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
558605
```
559606

560607
# [Kubernetes](#tab/kubernetes)

0 commit comments

Comments
 (0)