Skip to content

Commit 5bf8a66

Browse files
Merge pull request #289261 from jlian/main
Fix inaccurate content
2 parents 3a86ab1 + 0327f6e commit 5bf8a66

File tree

6 files changed

+78
-87
lines changed

6 files changed

+78
-87
lines changed

articles/iot-operations/connect-to-cloud/howto-configure-mqtt-endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ MQTT dataflow endpoints are used for MQTT sources and destinations. You can conf
2323
- An instance of [Azure IoT Operations Preview](../deploy-iot-ops/howto-deploy-iot-operations.md)
2424
- A [configured dataflow profile](howto-configure-dataflow-profile.md)
2525

26-
## Azure IoT Operations Local MQTT broker
26+
## Azure IoT Operations local MQTT broker
2727

2828
### Default endpoint
2929

articles/iot-operations/connect-to-cloud/tutorial-mqtt-bridge.md

Lines changed: 64 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Using Azure CLI, find the principal ID for the Azure IoT Operations Arc extensio
9292
```azurecli
9393
export PRINCIPAL_ID=$(az k8s-extension list \
9494
--resource-group $RESOURCE_GROUP \
95-
--cluster-name <CLUSTER-NAME> \
95+
--cluster-name $CLUSTER_NAME \
9696
--cluster-type connectedClusters \
9797
--query "[?extensionType=='microsoft.iotoperations'].identity.principalId | [0]" -o tsv)
9898
echo $PRINCIPAL_ID
@@ -145,77 +145,34 @@ Take note of the output value for `topicSpacesConfiguration.hostname` that is a
145145
example.region-1.ts.eventgrid.azure.net
146146
```
147147

148-
## Create an Azure IoT Operations MQTT broker dataflow endpoint
148+
## Understand the default Azure IoT Operations MQTT broker dataflow endpoint
149149

150-
# [Bicep](#tab/bicep)
151-
152-
The dataflow and dataflow endpoints for MQTT broker and Azure Event Grid can be deployed as standard Azure resources since they have Azure Resource Provider (RPs) implementations. This Bicep template file from [Bicep File for MQTT-bridge dataflow Tutorial](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/quickstarts/dataflow.bicep) deploys the necessary dataflow and dataflow endpoints.
153-
154-
Download the file to your local, and make sure to replace the values for `customLocationName`, `aioInstanceName`, `eventGridHostName` with yours.
150+
By default, Azure IoT Operations deploys an MQTT broker as well as an MQTT broker dataflow endpoint. The MQTT broker dataflow endpoint is used to connect to the MQTT broker. The default configuration uses the built-in service account token for authentication. The endpoint is named `default` and is available in the same namespace as Azure IoT Operations. The endpoint is used as the source for the dataflows you create in the next steps.
155151

156-
Next, execute the following command in your terminal:
152+
To learn more about the default MQTT broker dataflow endpoint, see [Azure IoT Operations local MQTT broker default endpoint](../connect-to-cloud/howto-configure-mqtt-endpoint.md#default-endpoint).
157153

158-
```azurecli
159-
az stack group create --name MyDeploymentStack --resource-group $RESOURCE_GROUP --template-file /workspaces/explore-iot-operations/mqtt-bridge.bicep --action-on-unmanage 'deleteResources' --deny-settings-mode 'none' --yes
160-
```
161-
This endpoint is the source for the dataflow that sends messages to Azure Event Grid.
162-
163-
```bicep
164-
resource MqttBrokerDataflowEndpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-08-15-preview' = {
165-
parent: aioInstance
166-
name: 'aiomq'
167-
extendedLocation: {
168-
name: customLocation.id
169-
type: 'CustomLocation'
170-
}
171-
properties: {
172-
endpointType: 'Mqtt'
173-
mqttSettings: {
174-
authentication: {
175-
method: 'ServiceAccountToken'
176-
serviceAccountTokenSettings: {
177-
audience: 'aio-internal'
178-
}
179-
}
180-
host: 'aio-broker:18883'
181-
tls: {
182-
mode: 'Enabled'
183-
trustedCaCertificateConfigMapRef: 'azure-iot-operations-aio-ca-trust-bundle'
184-
}
185-
}
186-
}
187-
}
188-
```
189-
190-
# [Kubernetes](#tab/kubernetes)
191-
192-
Create dataflow endpoint for the Azure IoT Operations built-in MQTT broker. This endpoint is the source for the dataflow that sends messages to Azure Event Grid.
154+
## Create an Azure Event Grid dataflow endpoint
193155

194-
```yaml
195-
apiVersion: connectivity.iotoperations.azure.com/v1beta1
196-
kind: DataflowEndpoint
197-
metadata:
198-
name: mq
199-
namespace: azure-iot-operations
200-
spec:
201-
endpointType: Mqtt
202-
mqttSettings:
203-
authentication:
204-
method: ServiceAccountToken
205-
serviceAccountTokenSettings: {}
206-
```
156+
Create dataflow endpoint for the Azure Event Grid. This endpoint is the destination for the dataflow that sends messages to Azure Event Grid. Replace `<EVENT_GRID_HOSTNAME>` with the MQTT hostname you got from the previous step. Include the port number `8883`.
207157

208-
---
158+
# [Bicep](#tab/bicep)
209159

210-
This is the default configuration for the Azure IoT Operations MQTT broker endpoint. The authentication method is set to `ServiceAccountToken` to use the built-in service account token for authentication.
160+
The dataflow and dataflow endpoints Azure Event Grid can be deployed as standard Azure resources since they have Azure Resource Provider (RPs) implementations. This Bicep template file from [Bicep File for MQTT-bridge dataflow Tutorial](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/quickstarts/dataflow.bicep) deploys the necessary dataflow and dataflow endpoints.
211161

212-
## Create an Azure Event Grid dataflow endpoint
162+
Download the file to your local, and make sure to replace the values for `customLocationName`, `aioInstanceName`, `eventGridHostName` with yours.
213163

214-
# [Bicep](#tab/bicep)
164+
```bicep
165+
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
166+
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
167+
param eventGridHostName string = '<EVENT_GRID_HOSTNAME>:8883'
215168
216-
Since you already deployed the resources in the previous section, there's no additional deployment needed. However, this endpoint is the destination for the dataflow that sends messages to Azure Event Grid. Replace `<EVENT-GRID-HOSTNAME>` with the hostname you got from the previous step. Include the port number `8883`.
169+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
170+
name: customLocationName
171+
}
217172
218-
```bicep
173+
resource aioInstance 'Microsoft.IoTOperations/instances@2024-08-15-preview' existing = {
174+
name: aioInstanceName
175+
}
219176
resource remoteMqttBrokerDataflowEndpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-08-15-preview' = {
220177
parent: aioInstance
221178
name: 'eventgrid'
@@ -230,7 +187,7 @@ resource remoteMqttBrokerDataflowEndpoint 'Microsoft.IoTOperations/instances/dat
230187
method: 'SystemAssignedManagedIdentity'
231188
systemAssignedManagedIdentitySettings: {}
232189
}
233-
host: '<NAMESPACE>.<REGION>-1.ts.eventgrid.azure.net:8883'
190+
host: eventGridHostName
234191
tls: {
235192
mode: 'Enabled'
236193
}
@@ -239,9 +196,13 @@ resource remoteMqttBrokerDataflowEndpoint 'Microsoft.IoTOperations/instances/dat
239196
}
240197
```
241198

242-
# [Kubernetes](#tab/kubernetes)
199+
Next, execute the following command in your terminal. Replace `<FILE>` with the name of the Bicep file you downloaded.
243200

244-
Create dataflow endpoint for the Azure Event Grid. This endpoint is the destination for the dataflow that sends messages to Azure Event Grid. Replace `<EVENT-GRID-HOSTNAME>` with the hostname you got from the previous step. Include the port number `8883`.
201+
```azurecli
202+
az stack group create --name DeployDataflowEndpoint --resource-group $RESOURCE_GROUP --template-file <FILE>.bicep --action-on-unmanage 'deleteResources' --deny-settings-mode 'none' --yes
203+
```
204+
205+
# [Kubernetes](#tab/kubernetes)
245206

246207
```yaml
247208
apiVersion: connectivity.iotoperations.azure.com/v1beta1
@@ -252,7 +213,7 @@ metadata:
252213
spec:
253214
endpointType: Mqtt
254215
mqttSettings:
255-
host: <EVENT-GRID-HOSTNAME>:8883
216+
host: <EVENT_GRID_HOSTNAME>:8883
256217
authentication:
257218
method: SystemAssignedManagedIdentity
258219
systemAssignedManagedIdentitySettings: {}
@@ -268,11 +229,24 @@ Since the Event Grid MQTT broker requires TLS, the `tls` setting is enabled. No
268229

269230
## Create dataflows
270231

271-
# [Bicep](#tab/bicep)
232+
Create two dataflows with the Azure IoT Operations MQTT broker endpoint as the source and the Azure Event Grid endpoint as the destination, and vice versa. No need to configure transformation.
272233

273-
In this example, there are two dataflows with the Azure IoT Operations MQTT broker endpoint as the source and the Azure Event Grid endpoint as the destination, and vice versa. No need to configure transformation.
234+
# [Bicep](#tab/bicep)
274235

275236
```bicep
237+
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
238+
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
239+
240+
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
241+
name: customLocationName
242+
}
243+
resource aioInstance 'Microsoft.IoTOperations/instances@2024-08-15-preview' existing = {
244+
name: aioInstanceName
245+
}
246+
resource defaultDataflowProfile 'Microsoft.IoTOperations/instances/dataflowProfiles@2024-08-15-preview' existing = {
247+
parent: aioInstance
248+
name: 'default'
249+
}
276250
resource dataflow_1 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflows@2024-08-15-preview' = {
277251
parent: defaultDataflowProfile
278252
name: 'local-to-remote'
@@ -286,15 +260,15 @@ resource dataflow_1 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflow
286260
{
287261
operationType: 'Source'
288262
sourceSettings: {
289-
endpointRef: MqttBrokerDataflowEndpoint.name
263+
endpointRef: 'default'
290264
dataSources: array('tutorial/local')
291265
}
292266
}
293267
{
294268
operationType: 'Destination'
295269
destinationSettings: {
296270
endpointRef: remoteMqttBrokerDataflowEndpoint.name
297-
dataDestination: 'telemetry/iot-mq'
271+
dataDestination: 'telemetry/aio'
298272
}
299273
}
300274
]
@@ -323,7 +297,7 @@ resource dataflow_2 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflow
323297
{
324298
operationType: 'Destination'
325299
destinationSettings: {
326-
endpointRef: MqttBrokerDataflowEndpoint.name
300+
endpointRef: 'default'
327301
dataDestination: 'tutorial/cloud'
328302
}
329303
}
@@ -332,9 +306,14 @@ resource dataflow_2 'Microsoft.IoTOperations/instances/dataflowProfiles/dataflow
332306
}
333307
```
334308

309+
Like the dataflow endpoint, execute the following command in your terminal:
310+
311+
```azurecli
312+
az stack group create --name DeployDataflows --resource-group $RESOURCE_GROUP --template-file <FILE>.bicep --action-on-unmanage 'deleteResources' --deny-settings-mode 'none' --yes
313+
```
314+
335315
# [Kubernetes](#tab/kubernetes)
336316

337-
Create two dataflows with the Azure IoT Operations MQTT broker endpoint as the source and the Azure Event Grid endpoint as the destination, and vice versa. No need to configure transformation.
338317

339318
```yaml
340319
apiVersion: connectivity.iotoperations.azure.com/v1beta1
@@ -347,13 +326,13 @@ spec:
347326
operations:
348327
- operationType: Source
349328
sourceSettings:
350-
endpointRef: mq
329+
endpointRef: default
351330
dataSources:
352331
- tutorial/local
353332
- operationType: Destination
354333
destinationSettings:
355334
endpointRef: eventgrid
356-
dataDestination: telemetry/iot-mq
335+
dataDestination: telemetry/aio
357336
---
358337
apiVersion: connectivity.iotoperations.azure.com/v1beta1
359338
kind: Dataflow
@@ -370,7 +349,7 @@ spec:
370349
- telemetry/#
371350
- operationType: Destination
372351
destinationSettings:
373-
endpointRef: mq
352+
endpointRef: default
374353
dataDestination: tutorial/cloud
375354
```
376355

@@ -383,10 +362,10 @@ Together, the two dataflows form an MQTT bridge, where you:
383362
* Use TLS for both remote and local brokers
384363
* Use system-assigned managed identity for authentication to the remote broker
385364
* Use Kubernetes service account for authentication to the local broker
386-
* Use the topic map to map the `tutorial/local` topic to the `telemetry/iot-mq` topic on the remote broker
365+
* Use the topic map to map the `tutorial/local` topic to the `telemetry/aio` topic on the remote broker
387366
* Use the topic map to map the `telemetry/#` topic on the remote broker to the `tutorial/cloud` topic on the local broker
388367

389-
When you publish to the `tutorial/local` topic on the local Azure IoT Operations MQTT broker, the message is bridged to the `telemetry/iot-mq` topic on the remote Event Grid MQTT broker. Then, the message is bridged back to the `tutorial/cloud` topic (because the `telemetry/#` wildcard topic captures it) on the local Azure IoT Operations MQTT broker. Similarly, when you publish to the `telemetry/iot-mq` topic on the remote Event Grid MQTT broker, the message is bridged to the `tutorial/cloud` topic on the local Azure IoT Operations MQTT broker.
368+
When you publish to the `tutorial/local` topic on the local Azure IoT Operations MQTT broker, the message is bridged to the `telemetry/aio` topic on the remote Event Grid MQTT broker. Then, the message is bridged back to the `tutorial/cloud` topic (because the `telemetry/#` wildcard topic captures it) on the local Azure IoT Operations MQTT broker. Similarly, when you publish to the `telemetry/aio` topic on the remote Event Grid MQTT broker, the message is bridged to the `tutorial/cloud` topic on the local Azure IoT Operations MQTT broker.
390369

391370
## Deploy MQTT client
392371

@@ -404,14 +383,20 @@ Currently, bicep doesn't apply to deploy MQTT client.
404383

405384
```yaml
406385
apiVersion: v1
386+
kind: ServiceAccount
387+
metadata:
388+
name: mqtt-client
389+
namespace: azure-iot-operations
390+
---
391+
apiVersion: v1
407392
kind: Pod
408393
metadata:
409394
name: mqtt-client
410395
# Namespace must match MQTT broker BrokerListener's namespace
411396
# Otherwise use the long hostname: aio-broker.azure-iot-operations.svc.cluster.local
412397
namespace: azure-iot-operations
413398
spec:
414-
# Use the "mqtt-client" service account which comes with default deployment
399+
# Use the "mqtt-client" service account from above
415400
# Otherwise create it with `kubectl create serviceaccount mqtt-client -n azure-iot-operations`
416401
serviceAccountName: mqtt-client
417402
containers:
@@ -435,7 +420,7 @@ spec:
435420
expirationSeconds: 86400
436421
- name: trust-bundle
437422
configMap:
438-
name: aio-ca-trust-bundle-test-only # Default root CA cert
423+
name: azure-iot-operations-aio-ca-trust-bundle # Default root CA cert
439424
```
440425
441426
Apply the deployment file with kubectl.

articles/iot-operations/create-edge-apps/howto-develop-dapr-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ The following definition components might require customization to your specific
113113
# Certificate chain for Dapr to validate the MQTT broker
114114
- name: aio-ca-trust-bundle
115115
configMap:
116-
name: aio-ca-trust-bundle-test-only
116+
name: azure-iot-operations-aio-ca-trust-bundle
117117
118118
containers:
119119
# Container for the Dapr application

articles/iot-operations/create-edge-apps/howto-develop-mqttnet-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ spec:
100100
# Certificate chain for the application to validate the MQTT broker
101101
- name: aio-ca-trust-bundle
102102
configMap:
103-
name: aio-ca-trust-bundle-test-only
103+
name: azure-iot-operations-aio-ca-trust-bundle
104104

105105
containers:
106106
- name: mqtt-client-dotnet

articles/iot-operations/create-edge-apps/tutorial-event-driven-with-dapr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ To start, create a yaml file that uses the following definitions:
9191
# Certificate chain for Dapr to validate the MQTT broker
9292
- name: aio-ca-trust-bundle
9393
configMap:
94-
name: aio-ca-trust-bundle-test-only
94+
name: azure-iot-operations-aio-ca-trust-bundle
9595

9696
containers:
9797
- name: mq-event-driven-dapr
@@ -189,7 +189,7 @@ To verify the MQTT bridge is working, deploy an MQTT client to the cluster.
189189
expirationSeconds: 86400
190190
- name: aio-ca-trust-bundle
191191
configMap:
192-
name: aio-ca-trust-bundle-test-only
192+
name: azure-iot-operations-aio-ca-trust-bundle
193193
```
194194

195195
1. Apply the deployment file with kubectl:

articles/iot-operations/manage-mqtt-broker/howto-test-connection.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ The first option is to connect from within the cluster. This option uses the def
4141

4242
```yaml
4343
apiVersion: v1
44+
kind: ServiceAccount
45+
metadata:
46+
name: mqtt-client
47+
namespace: azure-iot-operations
48+
---
49+
apiVersion: v1
4450
kind: Pod
4551
metadata:
4652
name: mqtt-client
4753
# Namespace must match MQTT broker BrokerListener's namespace
4854
# Otherwise use the long hostname: aio-broker.azure-iot-operations.svc.cluster.local
4955
namespace: azure-iot-operations
5056
spec:
51-
# Use the "mqtt-client" service account which comes with default deployment
57+
# Use the "mqtt-client" service account created from above
5258
# Otherwise create it with `kubectl create serviceaccount mqtt-client -n azure-iot-operations`
5359
serviceAccountName: mqtt-client
5460
containers:
@@ -128,10 +134,10 @@ The first option is to connect from within the cluster. This option uses the def
128134

129135
Since the broker uses TLS, the client must trust the broker's TLS certificate chain. You need to configure the client to trust the root CA certificate used by the broker.
130136

131-
To use the default root CA certificate, download it from the `aio-ca-trust-bundle-test-only` ConfigMap:
137+
To use the default root CA certificate, download it from the `azure-iot-operations-aio-ca-trust-bundle` ConfigMap:
132138

133139
```bash
134-
kubectl get configmap aio-ca-trust-bundle-test-only -n azure-iot-operations -o jsonpath='{.data.ca\.crt}' > ca.crt
140+
kubectl get configmap azure-iot-operations-aio-ca-trust-bundle -n azure-iot-operations -o jsonpath='{.data.ca\.crt}' > ca.crt
135141
```
136142

137143
Use the downloaded `ca.crt` file to configure your client to trust the broker's TLS certificate chain.

0 commit comments

Comments
 (0)