Skip to content

Commit df53c2c

Browse files
committed
Fix bicep
1 parent dd748be commit df53c2c

File tree

3 files changed

+64
-85
lines changed

3 files changed

+64
-85
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: Configure MQTT broker authentication
33
description: Configure MQTT broker authentication.
44
author: PatAltimore
55
ms.author: patricka
6+
ms.service: azure-iot-operations
67
ms.subservice: azure-mqtt-broker
78
ms.topic: how-to
89
ms.custom:
910
- ignite-2023
1011
ms.date: 10/30/2024
1112

1213
#CustomerIntent: As an operator, I want to configure authentication so that I have secure MQTT broker communications.
13-
ms.service: azure-iot-operations
1414
---
1515

1616
# Configure MQTT broker authentication

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

Lines changed: 62 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -56,56 +56,7 @@ To view or edit the listener:
5656

5757
# [Bicep](#tab/bicep)
5858

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.
10960

11061
# [Kubernetes](#tab/kubernetes)
11162

@@ -186,6 +137,7 @@ This example shows how to create a new *BrokerListener* resource named *loadbala
186137
```bicep
187138
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
188139
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
140+
param listenerServiceName string = '<LISTENER_SERVICE_NAME>'
189141
param listenerName string = '<LISTENER_NAME>'
190142
191143
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
@@ -196,17 +148,12 @@ resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-p
196148
name: customLocationName
197149
}
198150
199-
resource broker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' = {
151+
resource defaultBroker 'Microsoft.IoTOperations/instances/brokers@2024-09-15-preview' existing = {
200152
parent: aioInstance
201153
name: 'default'
202154
}
203155
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' = {
210157
parent: defaultBroker
211158
name: listenerName
212159
extendedLocation: {
@@ -215,9 +162,8 @@ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/default
215162
}
216163
217164
properties: {
218-
brokerRef: 'default'
219-
serviceName: 'aio-broker-loadbalancer'
220-
serviceType: 'ClusterIp'
165+
serviceName: listenerServiceName
166+
serviceType: 'LoadBalancer'
221167
ports: [
222168
{
223169
authenticationRef: 'default'
@@ -239,6 +185,12 @@ resource loadBalancerListener 'Microsoft.IoTOperations/instances/brokers/default
239185
}
240186
```
241187

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+
242194
# [Kubernetes](#tab/kubernetes)
243195

244196
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
467419
```bicep
468420
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
469421
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
422+
param listenerServiceName string = '<LISTENER_SERVICE_NAME>'
423+
param listenerName string = '<LISTENER_NAME>'
470424
471425
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
472426
name: aioInstanceName
473427
}
428+
474429
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
475430
name: customLocationName
476431
}
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
480441
extendedLocation: {
481-
name: customLocationName
442+
name: customLocation.id
482443
type: 'CustomLocation'
483444
}
445+
484446
properties: {
485-
brokerRef: 'default'
486-
serviceType: 'loadBalancer'
487-
serviceName: 'aio-broker-loadbalancer-tls'
447+
serviceName: listenerServiceName
448+
serviceType: 'LoadBalancer'
488449
ports: [
489450
{
451+
authenticationRef: 'default'
490452
port: 8884
491453
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'
498457
}
499458
}
500459
}
@@ -504,6 +463,12 @@ resource BrokerListener 'Microsoft.IoTOperations/instances/dataflowEndpoints@202
504463
505464
```
506465

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+
507472
#### Optional: Configure server certificate parameters
508473

509474
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
555520
}
556521
}
557522
}
523+
]
558524
559525
```
560526

@@ -747,29 +713,36 @@ The following is an example of a BrokerListener resource that enables TLS on por
747713
```bicep
748714
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
749715
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
716+
param listenerServiceName string = '<LISTENER_SERVICE_NAME>'
717+
param listenerName string = '<LISTENER_NAME>'
750718
751719
resource aioInstance 'Microsoft.IoTOperations/instances@2024-09-15-preview' existing = {
752720
name: aioInstanceName
753721
}
722+
754723
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
755724
name: customLocationName
756725
}
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
760735
extendedLocation: {
761-
name: customLocationName
736+
name: customLocation.id
762737
type: 'CustomLocation'
763738
}
739+
764740
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'
770743
ports: [
771744
{
772-
// Avoid port conflict with default listener at 18883
745+
authenticationRef: 'default'
773746
port: 8885
774747
tls: {
775748
mode: 'Manual'
@@ -784,6 +757,12 @@ resource BrokerListener 'Microsoft.IoTOperations/instances/dataflowEndpoints@202
784757
785758
```
786759

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+
787766
# [Kubernetes](#tab/kubernetes)
788767

789768
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).

articles/iot-operations/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ items:
5959
href: manage-mqtt-broker/overview-iot-mq.md
6060
- name: Configure core MQTT broker settings
6161
href: manage-mqtt-broker/howto-configure-availability-scale.md
62-
- name: Secure MQTT communication endpoints
62+
- name: Configure MQTT broker listener
6363
href: manage-mqtt-broker/howto-configure-brokerlistener.md
6464
- name: Configure authentication
6565
href: manage-mqtt-broker/howto-configure-authentication.md

0 commit comments

Comments
 (0)