Schedule a bulk Azure IoT Hub job to update device twins or invoke a direct method across many devices at once
domain: iot · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Confirm your IoT hub is on the Standard tier — scheduled jobs aren't available on the Basic/Free tier
Build a device query to target the device set, e.g. `deviceId IN ['MyDevice1','MyDevice2']` or a twin query condition
For a bulk direct method call, send `PUT https://<hub>/jobs/v2/<jobId>?api-version=2021-04-12` with `"type": "scheduleDeviceMethod"` and a `cloudToDeviceMethod` object (methodName, payload, responseTimeoutInSeconds)
For a bulk twin update, send the same PUT with `"type": "scheduleUpdateTwin"` and an `updateTwin` patch object that includes a matching etag (e.g. `etag: "*"`)
Set `queryCondition`, `startTime` (ISO-8601), and `maxExecutionTimeInSeconds` on the request, then poll `GET https://<hub>/jobs/v2/<jobId>?api-version=2021-04-12` to track `deviceJobStatistics` (succeeded/failed/pending/running counts)
Known gotchas
The `updateTwin` job fails without a valid etag match on the patch
`jobId` must be 64 characters or fewer, using only US-ASCII letters, numbers, and dashes
Job history is retained for only 30 days (TTL) with no explicit purge mechanism — don't rely on querying older jobs
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?