az iot device c2d-message
Cloud-to-device messaging commands.
Commands
az iot device c2d-message abandon |
Abandon a cloud-to-device message. |
az iot device c2d-message complete |
Complete a cloud-to-device message. |
az iot device c2d-message purge |
Purge cloud-to-device message queue for a target device. |
az iot device c2d-message receive |
Receive a cloud-to-device message. |
az iot device c2d-message reject |
Reject or deadletter a cloud-to-device message. |
az iot device c2d-message send |
Send a cloud-to-device message. |
az iot device c2d-message abandon
Abandon a cloud-to-device message.
az iot device c2d-message abandon --device-id
--etag
[--hub-name]
[--login]
[--resource-group]
Required Parameters
Target Device.
Entity tag value.
Optional Parameters
IoT Hub name.
This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az iot device c2d-message complete
Complete a cloud-to-device message.
az iot device c2d-message complete --device-id
--etag
[--hub-name]
[--login]
[--resource-group]
Required Parameters
Target Device.
Entity tag value.
Optional Parameters
IoT Hub name.
This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az iot device c2d-message purge
Purge cloud-to-device message queue for a target device.
az iot device c2d-message purge --device-id
[--hub-name]
[--login]
[--resource-group]
Required Parameters
Target Device.
Optional Parameters
IoT Hub name.
This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az iot device c2d-message receive
Receive a cloud-to-device message.
Note: Only one message ack argument [--complete, --reject, --abandon] will be accepted.
az iot device c2d-message receive --device-id
[--abandon {false, true}]
[--complete {false, true}]
[--hub-name]
[--lock-timeout]
[--login]
[--reject {false, true}]
[--resource-group]
Examples
Basic usage
az iot device c2d-message receive -d {device_id} -n {hub_name} -g {resource_group}
Receive a message and set a lock timeout of 30 seconds for that message
az iot device c2d-message receive -d {device_id} -n {hub_name} -g {resource_group} --lt {30}
Receive a message and ack it as 'complete' after it is received
az iot device c2d-message receive -d {device_id} -n {hub_name} -g {resource_group} --complete
Receive a message and reject it after it is received
az iot device c2d-message receive -d {device_id} -n {hub_name} -g {resource_group} --reject
Required Parameters
Target Device.
Optional Parameters
Abandon the cloud-to-device message after receipt.
Complete the cloud-to-device message after receipt.
IoT Hub name.
Specifies the amount of time a message will be invisible to other receive calls.
This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.
Reject the cloud-to-device message after receipt.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az iot device c2d-message reject
Reject or deadletter a cloud-to-device message.
az iot device c2d-message reject --device-id
--etag
[--hub-name]
[--login]
[--resource-group]
Required Parameters
Target Device.
Entity tag value.
Optional Parameters
IoT Hub name.
This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az iot device c2d-message send
Send a cloud-to-device message.
EXPERIMENTAL requires Python 3.4+ This command relies on and may install dependent Cython package (uamqp) upon first execution. https://github.com/Azure/azure-uamqp-python.
az iot device c2d-message send --device-id
[--ack {full, negative, positive}]
[--ce]
[--cid]
[--content-type]
[--da]
[--expiry]
[--hub-name]
[--login]
[--message-id]
[--properties]
[--repair {false, true}]
[--resource-group]
[--uid]
[--wait {false, true}]
[--yes {false, true}]
Examples
Basic usage with default message body
az iot device c2d-message send -d {device_id} -n {iothub_name}
Send cloud-to-device message with custom data and properties.
az iot device c2d-message send -d {device_id} -n {iothub_name} --data 'Hello World' --props 'key0=value0;key1=value1'
Send a C2D message and wait for device acknowledgement
az iot device c2d-message send -d {device_id} -n {iothub_name} --ack full --wait
Required Parameters
Target Device.
Optional Parameters
Request the delivery of per-message feedback regarding the final state of that message. The description of ack values is as follows. Positive: If the c2d message reaches the Completed state, IoT Hub generates a feedback message. Negative: If the c2d message reaches the Dead lettered state, IoT Hub generates a feedback message. Full: IoT Hub generates a feedback message in either case. By default, no ack is requested.
The content encoding associated with the C2D message.
The correlation Id associated with the C2D message.
The content type associated with the C2D message.
Message body.
Units are milliseconds since unix epoch. If no time is indicated the default IoT Hub C2D message TTL is used.
IoT Hub name.
This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.
The C2D message Id. If no message Id is provided a UUID will be generated.
Message property bag in key-value pairs with the following format: a=b;c=d.
Reinstall uamqp dependency compatible with extension version. Default: false.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The C2D message, user Id property.
If set the c2d send operation will block until device feedback has been received.
Skip user prompts. Indicates acceptance of dependency installation (if required). Used primarily for automation scenarios. Default: false.
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.
Increase logging verbosity. Use --debug for full debug logs.