You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-operations/manage-mqtt-broker/howto-test-connection.md
+31-3Lines changed: 31 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: sethmanheim
5
5
ms.author: sethm
6
6
ms.subservice: azure-mqtt-broker
7
7
ms.topic: how-to
8
-
ms.date: 11/06/2024
8
+
ms.date: 02/11/2026
9
9
10
10
#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.
@@ -135,6 +135,18 @@ For example, to create a new broker listener with the `NodePort` service type, s
135
135
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).
136
136
1. Select **Create** to create the listener.
137
137
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
+
138
150
# [Bicep](#tab/bicep)
139
151
140
152
> [!CAUTION]
@@ -295,6 +307,14 @@ For example, to create a new broker listener with the `LoadBalancer` service typ
295
307
1. Select **Create** to create the listener.
296
308
1. Select **Create** to create the listener.
297
309
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
+
298
318
# [Bicep](#tab/bicep)
299
319
300
320
> [!CAUTION]
@@ -504,6 +524,14 @@ The reason that the MQTT broker uses TLS and service accounts authentication by
504
524
505
525
1. Select **Create** to create the listener.
506
526
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
0 commit comments