Closed davidjrh closed 4 years ago
@davidjrh
Thanks for reporting the issue we will take a look at it.
Best Regards, Zoltan
This may have been a service side bug at some point, but I can't repro this on the current client SDK version against the current service, so I'm closing this issue
@davidjrh, @timtay-microsoft, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey
Description of the issue:
This seems a bug not from the device point of view, since the device registers correctly. I found the problem when building a client application with the Microsoft.Azure.Devices nuget (v1.6.0). After having the device correctly registered and responding to the direct methods calls done through the Azure portal, once I call the direct method of the device from a client app, the device is no longer available (message exception saying my device was not found).
Code sample exhibiting the issue:
I initially created a console app to call a direct method, that works well. The call was something like this:
But then I moved the code to another app and was causing the device being unregistered. After trying to find a difference, I found the cause using Fiddler. The console app was sending the following request body:
while the second app was sending the following on the request body:
The second application had this setting on the serializer:
So the problem I see on the IoT API, is that if for whatever reason I don't send the "payload" element on the request body, the device is disconnected, sounds like a bug on the server side.
Another workround is to send an explicit empty payload like this one: