question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating device twin tags are not working

See original GitHub issue

I 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.

image

When I check the JSON samples in in error message, and suggests to use --set tags={...} I get the same error. image

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ikivanccommented, Feb 15, 2022

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!

1reaction
digimauncommented, Feb 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found