az iot hub message-route
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.46.0 or higher). The extension will automatically install the first time you run an az iot hub message-route command. Learn more about extensions.
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Manage routes of an IoT hub.
Commands
Name | Description | Type | Status |
---|---|---|---|
az iot hub message-route create |
Add a route for an IoT Hub. |
Extension | Preview |
az iot hub message-route delete |
Delete all routes or a mentioned route in an IoT Hub. |
Extension | Preview |
az iot hub message-route fallback |
Manage the fallback route of an IoT hub. |
Extension | Preview |
az iot hub message-route fallback set |
Enable or disable the fallback route in an IoT Hub. |
Extension | Preview |
az iot hub message-route fallback show |
Show the fallback route of an IoT Hub. |
Extension | Preview |
az iot hub message-route list |
Get all the routes in an IoT Hub. |
Extension | Preview |
az iot hub message-route show |
Get information about the route in an IoT Hub. |
Extension | Preview |
az iot hub message-route test |
Test all routes or a mentioned route in an IoT Hub. |
Extension | Preview |
az iot hub message-route update |
Update a route for an IoT Hub. |
Extension | Preview |
az iot hub message-route create
Command group 'iot hub message-route' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Add a route for an IoT Hub.
az iot hub message-route create --en
--hub-name
--rn
--source-type {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}
[--condition]
[--enabled {false, true}]
[--resource-group]
Examples
Create a route for an IoT Hub with the given endpoint and source type "DeviceMessages".
az iot hub message-route create -n {iothub_name} --route-name {route_name} --endpoint-name {endpoint_name} --source DeviceMessages
Create a route for an IoT Hub with the built-in endpoint and source type "DeviceMessages".
az iot hub message-route create -n {iothub_name} --route-name {route_name} --endpoint-name events --source DeviceMessages
Create a disabled route for an IoT Hub with the given endpoint, source type "DigitalTwinChangeEvents" and custom condition.
az iot hub message-route create -n {iothub_name} --route-name {route_name} --endpoint-name {endpoint_name} --source DigitalTwinChangeEvents --condition {condition} --enabled false
Required Parameters
Name of the routing endpoint. For the built-in endpoint, use endpoint name 'events'.
IoT Hub name.
Name of the route.
Source of the route.
Optional Parameters
Condition that is evaluated to apply the routing rule.
A boolean indicating whether to enable route to the IoT Hub.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot hub message-route delete
Command group 'iot hub message-route' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Delete all routes or a mentioned route in an IoT Hub.
az iot hub message-route delete --hub-name
[--resource-group]
[--rn]
[--source-type {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
[--yes {false, true}]
Examples
Delete a route from an IoT Hub.
az iot hub message-route delete -n {iothub_name} --route-name {route_name}
Delete all routes of source type "DeviceMessages" from an IoT Hub.
az iot hub message-route delete -n {iothub_name} --source DeviceMessages
Delete all routes from an IoT Hub.
az iot hub message-route delete -n {iothub_name}
Required Parameters
IoT Hub name.
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the route.
Source of the route.
Skip user prompts. Indicates acceptance of action. Used primarily for automation scenarios. Default: false.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot hub message-route list
Command group 'iot hub message-route' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get all the routes in an IoT Hub.
az iot hub message-route list --hub-name
[--resource-group]
[--source-type {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
Examples
Get all routes from an IoT Hub.
az iot hub message-route list -n {iothub_name}
Get all the routes of source type "DeviceMessages" from an IoT Hub.
az iot hub message-route list -n {iothub_name} --source DeviceMessages
Required Parameters
IoT Hub name.
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Source of the route.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot hub message-route show
Command group 'iot hub message-route' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get information about the route in an IoT Hub.
az iot hub message-route show --hub-name
--rn
[--resource-group]
Examples
Get route information from an IoT Hub.
az iot hub message-route show -n {iothub_name} --route-name {route_name}
Required Parameters
IoT Hub name.
Name of the route.
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot hub message-route test
Command group 'iot hub message-route' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Test all routes or a mentioned route in an IoT Hub.
You can provide a sample message to test your routes.
az iot hub message-route test --hub-name
[--ap]
[--body]
[--resource-group]
[--rn]
[--source-type {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
[--sp]
Examples
Test a route from an IoT Hub.
az iot hub message-route test -n {iothub_name} --route-name {route_name}
Test all routes of source type "DeviceMessages" from an IoT Hub.
az iot hub message-route test -n {iothub_name} --source DeviceMessages
Test all route from an IoT Hub with a custom message, including body, app properties, and system properties.
az iot hub message-route test -n {iothub_name} -b {body} --ap {app_properties} --sp {system_properties}
Required Parameters
IoT Hub name.
Optional Parameters
App properties of the route message.
Body of the route message.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the route.
Source of the route.
System properties of the route message.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot hub message-route update
Command group 'iot hub message-route' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Update a route for an IoT Hub.
You can change the source, endpoint, condition, or enabled state on the route.
az iot hub message-route update --hub-name
--rn
[--condition]
[--en]
[--enabled {false, true}]
[--resource-group]
[--source-type {deviceconnectionstateevents, devicejoblifecycleevents, devicelifecycleevents, devicemessages, digitaltwinchangeevents, invalid, twinchangeevents}]
Examples
Update a route to a given endpoint and source type "DeviceMessages".
az iot hub message-route update -n {iothub_name} --route-name {route_name} --endpoint-name {endpoint_name} --source DeviceMessages
Disable a route.
az iot hub message-route update -n {iothub_name} --route-name {route_name} --enabled false
Change a route's condition.
az iot hub message-route update -n {iothub_name} --route-name {route_name} --condition {condition}
Required Parameters
IoT Hub name.
Name of the route.
Optional Parameters
Condition that is evaluated to apply the routing rule.
Name of the routing endpoint. For the built-in endpoint, use endpoint name 'events'.
A boolean indicating whether to enable route to the IoT Hub.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Source of the route.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI