@@ -56,56 +56,7 @@ To view or edit the listener:
56
56
57
57
# [ Bicep] ( #tab/bicep )
58
58
59
- To edit the default listener, create a Bicep ` .bicep ` file with the following content. Update the settings as needed, and replace the placeholder values like ` <AIO_INSTANCE_NAME> ` with your own.
60
-
61
- ``` bicep
62
- param aioInstanceName string = '<AIO_INSTANCE_NAME>'
63
- param customLocationName string = '<CUSTOM_LOCATION_NAME>'
64
-
65
- resource aioInstance 'Microsoft.IoTOperations/instances/brokers/default@2024-09-15-preview' existing = {
66
- name: aioInstanceName
67
- }
68
- resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
69
- name: customLocationName
70
- }
71
- resource defaultBrokerListener 'Microsoft.IoTOperations/instances/brokers/default/listeners/default@2024-09-15-preview' = {
72
- parent: aioInstance
73
- name: 'default'
74
- extendedLocation: {
75
- name: customLocationName
76
- type: 'CustomLocation'
77
- }
78
- properties: {
79
- brokerRef: 'default'
80
- serviceName: 'aio-broker'
81
- serviceType: 'ClusterIp'
82
- ports: [
83
- {
84
- authenticationRef: 'default'
85
- port: 18883
86
- protocol: 'Mqtt'
87
- tls: {
88
- certManagerCertificateSpec: {
89
- issuerRef: {
90
- group: 'cert-manager.io'
91
- kind: 'Issuer'
92
- name: 'mq-dmqtt-frontend'
93
- }
94
- }
95
- mode: 'Automatic'
96
- }
97
- }
98
- ]
99
- }
100
- }
101
-
102
- ```
103
-
104
- Deploy the Bicep file using Azure CLI.
105
-
106
- ``` azurecli
107
- az stack group create --name MyDeploymentStack --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep --dm None --aou deleteResources --yes
108
- ```
59
+ You should not modify the default listener using Bicep. Instead, create a new listener and configure it as needed.
109
60
110
61
# [ Kubernetes] ( #tab/kubernetes )
111
62
@@ -186,6 +137,7 @@ This example shows how to create a new *BrokerListener* resource named *loadbala
186
137
` ` ` bicep
187
138
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
188
139
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
140
+ param listenerServiceName string = '<LISTENER_SERVICE_NAME>'
189
141
param listenerName string = '<LISTENER_NAME>'
190
142
191
143
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
@@ -196,17 +148,12 @@ resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-p
196
148
name: customLocationName
197
149
}
198
150
199
- resource broker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' = {
151
+ resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
200
152
parent: aioInstance
201
153
name: 'default'
202
154
}
203
155
204
- resource defaultBroker 'Microsoft.IoTOperations/instances/brokers/default@2024-09-15-preview' = {
205
- parent: broker
206
- name: 'default'
207
- }
208
-
209
- resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/default/listeners@2024-09-15-preview' = {
156
+ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/listeners@2024-09-15-preview' = {
210
157
parent: defaultBroker
211
158
name: listenerName
212
159
extendedLocation: {
@@ -215,9 +162,8 @@ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/default
215
162
}
216
163
217
164
properties: {
218
- brokerRef: 'default'
219
- serviceName: 'aio-broker-loadbalancer'
220
- serviceType: 'ClusterIp'
165
+ serviceName: listenerServiceName
166
+ serviceType: 'LoadBalancer'
221
167
ports: [
222
168
{
223
169
authenticationRef: 'default'
@@ -239,6 +185,12 @@ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/default
239
185
}
240
186
` ` `
241
187
188
+ Deploy the Bicep file using Azure CLI.
189
+
190
+ ` ` ` azurecli
191
+ az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
192
+ ` ` `
193
+
242
194
# [Kubernetes](#tab/kubernetes)
243
195
244
196
To create these *BrokerListener* resources, apply this YAML manifest to your Kubernetes cluster :
@@ -467,34 +419,41 @@ The following is an example of a BrokerListener resource that enables TLS on por
467
419
` ` ` bicep
468
420
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
469
421
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
422
+ param listenerServiceName string = '<LISTENER_SERVICE_NAME>'
423
+ param listenerName string = '<LISTENER_NAME>'
470
424
471
425
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
472
426
name: aioInstanceName
473
427
}
428
+
474
429
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
475
430
name: customLocationName
476
431
}
477
- resource BrokerListener 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-09-15-preview' = {
478
- parent: aioInstanceName
479
- name: endpointName
432
+
433
+ resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
434
+ parent: aioInstance
435
+ name: 'default'
436
+ }
437
+
438
+ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/listeners@2024-09-15-preview' = {
439
+ parent: defaultBroker
440
+ name: listenerName
480
441
extendedLocation: {
481
- name: customLocationName
442
+ name: customLocation.id
482
443
type: 'CustomLocation'
483
444
}
445
+
484
446
properties: {
485
- brokerRef: 'default'
486
- serviceType: 'loadBalancer'
487
- serviceName: 'aio-broker-loadbalancer-tls'
447
+ serviceName: listenerServiceName
448
+ serviceType: 'LoadBalancer'
488
449
ports: [
489
450
{
451
+ authenticationRef: 'default'
490
452
port: 8884
491
453
tls: {
492
- mode: 'Automatic'
493
- certManagerCertificateSpec: {
494
- issuerRef: {
495
- name: 'my-issuer'
496
- kind: 'Issuer'
497
- }
454
+ mode: 'Manual'
455
+ manual: {
456
+ secretRef: 'server-cert-secret'
498
457
}
499
458
}
500
459
}
@@ -504,6 +463,12 @@ resource BrokerListener 'Microsoft.IoTOperations/instances/dataflowEndpoints@202
504
463
505
464
` ` `
506
465
466
+ Deploy the Bicep file using Azure CLI.
467
+
468
+ ` ` ` azurecli
469
+ az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
470
+ ` ` `
471
+
507
472
# ### Optional: Configure server certificate parameters
508
473
509
474
The only required parameters are `issuerRef.name` and `issuerRef.kind`. All properties of the generated TLS server certificates are automatically chosen. However, MQTT broker allows certain properties to be customized by specifying them in the BrokerListener resource, under `tls.automatic.issuerRef`. The following is an example of all supported properties :
@@ -555,6 +520,7 @@ The only required parameters are `issuerRef.name` and `issuerRef.kind`. All prop
555
520
}
556
521
}
557
522
}
523
+ ]
558
524
559
525
` ` `
560
526
@@ -747,29 +713,36 @@ The following is an example of a BrokerListener resource that enables TLS on por
747
713
` ` ` bicep
748
714
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
749
715
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
716
+ param listenerServiceName string = '<LISTENER_SERVICE_NAME>'
717
+ param listenerName string = '<LISTENER_NAME>'
750
718
751
719
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
752
720
name: aioInstanceName
753
721
}
722
+
754
723
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
755
724
name: customLocationName
756
725
}
757
- resource BrokerListener 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-09-15-preview' = {
758
- parent: aioInstanceName
759
- name: endpointName
726
+
727
+ resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
728
+ parent: aioInstance
729
+ name: 'default'
730
+ }
731
+
732
+ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/listeners@2024-09-15-preview' = {
733
+ parent: defaultBroker
734
+ name: listenerName
760
735
extendedLocation: {
761
- name: customLocationName
736
+ name: customLocation.id
762
737
type: 'CustomLocation'
763
738
}
739
+
764
740
properties: {
765
- brokerRef: 'default'
766
- // Optional, defaults to clusterIP
767
- serviceType: 'loadBalancer'
768
- // Match the SAN in the server certificate
769
- serviceName: 'aio-broker-loadbalancer-tls'
741
+ serviceName: listenerServiceName
742
+ serviceType: 'LoadBalancer'
770
743
ports: [
771
744
{
772
- // Avoid port conflict with default listener at 18883
745
+ authenticationRef: ' default'
773
746
port: 8885
774
747
tls: {
775
748
mode: 'Manual'
@@ -784,6 +757,12 @@ resource BrokerListener 'Microsoft.IoTOperations/instances/dataflowEndpoints@202
784
757
785
758
` ` `
786
759
760
+ Deploy the Bicep file using Azure CLI.
761
+
762
+ ` ` ` azurecli
763
+ az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
764
+ ` ` `
765
+
787
766
# [Kubernetes](#tab/kubernetes)
788
767
789
768
Modify the `tls` setting in a *BrokerListener* resource to specify manual TLS configuration referencing the Kubernetes secret. Note the name of the secret used for the TLS server certificate (`server-cert-secret` in the example previously).
0 commit comments