Updating device twin tags are not working
See original GitHub issueI want to update my device twin’s tags and based on official documentation. It suggests to use --tags
to add a tag to a device twin, unfortunately I get error even I try the sample provided in the documentation.
When I check the JSON samples in in error message, and suggests to use --set tags={...}
I get the same error.
When I use az iot hub device-twin replace
and provide full device twin json file it works.
az iot hub device-twin replace -d windmill-rp2-01 -n iot-windmill -j rp2-device-twin.json
Is it possible to check what’s missing?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: c5c4040e-2a33-0065-5b6d-971f012d1f97
- Version Independent ID: ba28af00-d28a-5211-decd-95231198a54e
- Content: az iot hub device-twin
- Content Source: latest/docs-ref-autogen/iot/hub/device-twin.yml
- Service: iot-hub
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Manage device groups in Device Update for Azure IoT Hub
Configure device groups in Device Update for Azure IoT Hub by using twin tags.
Read more >How can I tell when an update on an Azure IoT Hub device ...
I'm using Microsoft.Azure.Devices.RegistryManager.UpdateTwinAsync() to change device twins. The problem is that this is an async method that ...
Read more >Automate Device Updates with Device Twins in Azure IOT Hub
The solution backend can also replace desired properties, tags and receive notifications as and when the Device twin is modified.
Read more >Azure Percept/Edge device OTA Updates- - Clifford Agius
Or you can check in Device Twins which is nice as you can see all the details about your device that it is...
Read more >Azure IoT Hub Connector — Device Twin Support
The device twin properties are NOT pushed through ingress. Updating the current values requires clicking the Refresh button or reloading the Thing in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you so much @digimaun , error messages are a bit misleading, I totally missed that point. If there could be a clarification in
Tips
section that would be perfect!Hey @ikivanc thanks for submitting this issue. A problem with inline json input is syntax may change based on the shell.
In your screenshot, those attempts should work in bash – are you using
cmd
? In that case try"{\"country\": \"USA\"}"
i.e.az iot hub device-twin update -n iot-windmill -d windmill-rp2-01 --tags "{\"country\": \"USA\"}"
Please use
--desired
or--tags
to update the respective properties rather than--set
. Also both of those args should take file paths (where we have a gap in documentation).We will need to update our wiki to be more clear on inline json syntax difference between shells and to show file input for --tags/–desired is possible.