Skip to content

Commit 848bb2e

Browse files
committed
Get MQTT client from sample repo
1 parent c2d2cd7 commit 848bb2e

File tree

1 file changed

+9
-45
lines changed

1 file changed

+9
-45
lines changed

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

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -512,58 +512,22 @@ When you publish to the `tutorial/local` topic on the local Azure IoT Operations
512512

513513
## Deploy MQTT client
514514

515-
To verify the MQTT bridge is working, deploy an MQTT client to the same namespace as Azure IoT Operations. In a new file named `client.yaml`, specify the client deployment:
516-
517-
<!-- TODO: put this in the explore-iot-operations repo? -->
515+
To verify the MQTT bridge is working, deploy an MQTT client to the same namespace as Azure IoT Operations.
518516

519517
# [Bicep](#tab/bicep)
520518

521-
Currently, bicep doesn't apply to deploy MQTT client.
519+
Currently, Bicep doesn't apply to deploy MQTT client.
522520

523521
# [Kubernetes (preview)](#tab/kubernetes)
524522

525-
```yaml
526-
apiVersion: v1
527-
kind: ServiceAccount
528-
metadata:
529-
name: mqtt-client
530-
namespace: azure-iot-operations
531-
---
532-
apiVersion: v1
533-
kind: Pod
534-
metadata:
535-
name: mqtt-client
536-
# Namespace must match MQTT broker BrokerListener's namespace
537-
# Otherwise use the long hostname: aio-broker.azure-iot-operations.svc.cluster.local
538-
namespace: azure-iot-operations
539-
spec:
540-
# Use the "mqtt-client" service account from above
541-
# Otherwise create it with `kubectl create serviceaccount mqtt-client -n azure-iot-operations`
542-
serviceAccountName: mqtt-client
543-
containers:
544-
# Mosquitto and mqttui on Alpine
545-
- image: alpine
546-
name: mqtt-client
547-
command: ["sh", "-c"]
548-
args: ["apk add mosquitto-clients mqttui && sleep infinity"]
549-
volumeMounts:
550-
- name: broker-sat
551-
mountPath: /var/run/secrets/tokens
552-
- name: trust-bundle
553-
mountPath: /var/run/certs
554-
volumes:
555-
- name: broker-sat
556-
projected:
557-
sources:
558-
- serviceAccountToken:
559-
path: broker-sat
560-
audience: aio-internal # Must match audience in BrokerAuthentication
561-
expirationSeconds: 86400
562-
- name: trust-bundle
563-
configMap:
564-
name: azure-iot-operations-aio-ca-trust-bundle # Default root CA cert
565-
```
523+
Download `client.yaml` deployment from the GitHub sample repository.
566524

525+
> [!IMPORTANT]
526+
> Don't use the MQTT client in production. The client is for testing purposes only.
527+
528+
```bash
529+
wget https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/main/samples/quickstarts/mqtt-client.yaml -O mqtt-client.yaml
530+
```
567531
Apply the deployment file with kubectl.
568532

569533
```bash

0 commit comments

Comments
 (0)