Skip to content

Commit 8b1ccff

Browse files
Merge pull request #311280 from sethmanheim/mqqttest
Add CLI command for nodeport
2 parents 8f0a91d + 7401e3d commit 8b1ccff

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

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

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: sethmanheim
55
ms.author: sethm
66
ms.subservice: azure-mqtt-broker
77
ms.topic: how-to
8-
ms.date: 11/06/2024
8+
ms.date: 02/11/2026
99

1010
#CustomerIntent: As an operator or developer, I want to test MQTT connectivity with tools that I'm already familiar with to know that I set up my MQTT broker correctly.
1111
ms.service: azure-iot-operations
@@ -64,7 +64,7 @@ mosquitto_pub --host aio-broker --port 18883 --message "hello" --topic "world" -
6464

6565
The output should look similar to the following example:
6666

67-
```Output
67+
```output
6868
Client (null) sending CONNECT
6969
Client (null) received CONNACK (0)
7070
Client (null) sending PUBLISH (d0, q0, r0, m1, 'world', ... (5 bytes))
@@ -88,7 +88,7 @@ mosquitto_sub --host aio-broker --port 18883 --topic "world" --debug --cafile /v
8888
8989
The output should look similar to the following example:
9090

91-
```Output
91+
```output
9292
Client (null) sending CONNECT
9393
Client (null) received CONNACK (0)
9494
Client (null) sending SUBSCRIBE (Mid: 1, Topic: world, QoS: 0, Options: 0x00)
@@ -135,6 +135,18 @@ For example, to create a new broker listener with the `NodePort` service type, s
135135
1. Add TLS settings to the listener by selecting **TLS** > **Add** on the port. This step isn't required if you don't need TLS for testing. For more information, see [BrokerListener](howto-configure-brokerlistener.md).
136136
1. Select **Create** to create the listener.
137137

138+
# [CLI](#tab/cli)
139+
140+
To create a new broker listener with the `NodePort` service type, use the following Azure CLI command.
141+
142+
```azurecli
143+
az iot ops broker listener port add --service-type NodePort --nodeport <static port value>
144+
```
145+
146+
Optionally, for testing purposes only, you can use the `--add-insecure-listener` flag to create a listener without authentication and TLS. The `--add-insecure-listener` flag is only available on the instance deployment operation via the `az iot ops create` command. To add a port without authentication and TLS after deployment, you can use the `listener port add` operation as in the previous example, but omit the options for authentication or TLS.
147+
148+
For more information, see [az iot ops broker listener port add](/cli/azure/iot/ops/broker/listener/port).
149+
138150
# [Bicep](#tab/bicep)
139151

140152
> [!CAUTION]
@@ -295,6 +307,14 @@ For example, to create a new broker listener with the `LoadBalancer` service typ
295307
1. Select **Create** to create the listener.
296308
1. Select **Create** to create the listener.
297309

310+
# [CLI](#tab/cli)
311+
312+
To create a new broker listener with service type `LoadBalancer`, use the following Azure CLI command.
313+
314+
```azurecli
315+
az iot ops broker listener port add --port 1883 --listener newlistener --in myinstance -g mygroup
316+
```
317+
298318
# [Bicep](#tab/bicep)
299319

300320
> [!CAUTION]
@@ -504,6 +524,14 @@ The reason that the MQTT broker uses TLS and service accounts authentication by
504524

505525
1. Select **Create** to create the listener.
506526

527+
# [CLI](#tab/cli)
528+
529+
Use the following Azure CLI command to add or replace an existing listener port. Provide values that reflect the terminal resource state:
530+
531+
```azurecli
532+
az iot ops broker listener port add --port 1883 --listener newlistener --in myinstance -g mygroup
533+
```
534+
507535
# [Bicep](#tab/bicep)
508536

509537
> [!CAUTION]

0 commit comments

Comments
 (0)