Skip to content

Commit 5c264eb

Browse files
Merge pull request #219143 from IsmailMitchell/docs-editor/query-twins-1669052904
No dependency on LastActivityTime & Twin Query Time
2 parents 85511a7 + 34a291d commit 5c264eb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

articles/iot-hub/query-twins.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,22 @@ SELECT * FROM devices.modules
185185
## Twin query limitations
186186

187187
> [!IMPORTANT]
188-
> Query results can have a few minutes of delay with respect to the latest values in device twins. If querying individual device twins by ID, use the [get twin REST API](/java/api/com.microsoft.azure.sdk.iot.device.devicetwin). This API always returns the latest values and has higher throttling limits. You can issue the REST API directly or use the equivalent functionality in one of the [Azure IoT Hub Service SDKs](iot-hub-devguide-sdks.md#azure-iot-hub-service-sdks).
188+
> Query results are eventually consistent operations and delays of up to 30 minutes should be tolerated. In most instances, twin query returns results in the order of a few seconds. IoT Hub strives to provide low latency for all operations. However, due to network conditions and other unpredictable factors it cannot guarantee a certain latency.
189+
190+
An alternative option to twin queries is to query individual device twins by ID by using the [get twin REST API](/java/api/com.microsoft.azure.sdk.iot.device.devicetwin). This API always returns the latest values and has higher throttling limits. You can issue the REST API directly or use the equivalent functionality in one of the [Azure IoT Hub Service SDKs](iot-hub-devguide-sdks.md#azure-iot-hub-service-sdks).
189191

190192
Query expressions can have a maximum length of 8192 characters.
191193

192194
Currently, comparisons are supported only between primitive types (no objects), for instance `... WHERE properties.desired.config = properties.reported.config` is supported only if those properties have primitive values.
193195

196+
We recommend to not take a dependency on lastActivityTime found in Device Identity Properties for Twin Queries for any scenario. This field does not guarantee an accurate gauge of device status. Instead, please use IoT Device Lifecycle events to manage device state and activities. More information on how to use IoT Hub Lifecycle events in your solution, please visit [React to IoT Hub events by using Event Grid to trigger actions](/azure/iot-hub/iot-hub-event-grid).
197+
198+
199+
> [!Note]
200+
> Avoid making any assumptions about the maximum latency of this operation. Please refer to [Latency Solutions](/azure/iot-hub/iot-hub-devguide-quotas-throttling) for more information on how to build your solution taking latency into account.
201+
194202
## Next steps
195203

196204
* Understand the basics of the [IoT Hub query language](iot-hub-devguide-query-language.md)
205+
206+

0 commit comments

Comments
 (0)