Share via


az iot ops broker listener

Note

This reference is part of the azure-iot-ops extension for the Azure CLI (version 2.62.0 or higher). The extension will automatically install the first time you run an az iot ops broker listener command. Learn more about extensions.

Mqtt broker listener management.

Commands

Name Description Type Status
az iot ops broker listener apply

Create or replace an mqtt broker listener service.

Extension GA
az iot ops broker listener delete

Delete an mqtt broker listener.

Extension GA
az iot ops broker listener list

List mqtt broker listeners associated with a broker.

Extension GA
az iot ops broker listener port

Mqtt broker listener port operations.

Extension GA
az iot ops broker listener port add

Add a tcp port config to an mqtt broker listener service.

Extension GA
az iot ops broker listener port remove

Remove a tcp port config from an mqtt broker listener service.

Extension GA
az iot ops broker listener show

Show details of an mqtt broker listener.

Extension GA

az iot ops broker listener apply

Create or replace an mqtt broker listener service.

An example of the config file format is as follows:

{
  "serviceType": "LoadBalancer",
  "ports": [
      {
          "port": 1883,
          "protocol": "Mqtt"
      },
      {
          "authenticationRef": "default",
          "port": 8883,
          "protocol": "Mqtt",
          "tls": {
              "mode": "Automatic",
              "certManagerCertificateSpec": {
                  "issuerRef": {
                      "name": "azure-iot-operations-aio-certificate-issuer",
                      "kind": "ClusterIssuer",
                      "group": "cert-manager.io"
                  }
              }
          }
      }
  ]
}

When used with apply the above content will create or replace a target listener with a two port configuration.

az iot ops broker listener apply --config-file
                                 --instance
                                 --name
                                 --resource-group
                                 [--broker]

Examples

Create or replace a listener for the default broker using a config file.

az iot ops broker listener apply -n listener --in myinstance -g myresourcegroup --config-file /path/to/listener/config.json

Required Parameters

--config-file

Path to a config file containing resource properties in json format. The config file should contain an object with properties compatible with the ARM representation of the resource. The object correlates directly with 'properties:{}' of the ARM resource.

--instance -i

IoT Operations instance name.

--name -n

Listener name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--broker -b

Broker name.

Default value: default
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot ops broker listener delete

Delete an mqtt broker listener.

az iot ops broker listener delete --instance
                                  --name
                                  --resource-group
                                  [--broker]
                                  [--yes {false, true}]

Examples

Delete an mqtt broker listener associated with the default broker.

az iot ops broker listener delete -n listener --in myinstance -g myresourcegroup

Same as prior example but skipping the confirmation prompt.

az iot ops broker listener delete -n listener --in myinstance -g myresourcegroup -y

Required Parameters

--instance -i

IoT Operations instance name.

--name -n

Listener name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--broker -b

Broker name.

Default value: default
--yes -y

Confirm [y]es without a prompt. Useful for CI and automation scenarios.

Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot ops broker listener list

List mqtt broker listeners associated with a broker.

az iot ops broker listener list --instance
                                --resource-group
                                [--broker]

Examples

Enumerate all mqtt broker listeners associated with the default broker.

az iot ops broker listener list --in myinstance -g myresourcegroup

Required Parameters

--instance -i

IoT Operations instance name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--broker -b

Broker name.

Default value: default
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot ops broker listener show

Show details of an mqtt broker listener.

az iot ops broker listener show --instance
                                --name
                                --resource-group
                                [--broker]

Examples

Show details of the default listener associated with the default broker.

az iot ops broker listener show -n default --in myinstance -g myresourcegroup

Required Parameters

--instance -i

IoT Operations instance name.

--name -n

Listener name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--broker -b

Broker name.

Default value: default
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.