You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When device twin replace was requested through TwinClient class, it does not update the twin when AzureSasCredential is used for connection. At the IotHub, neither update of device twin nor there is any exception from TwinClient.
Code sample exhibiting the issue
TwinClient method replace() does not work when the TwinClient uses AzureSasCredential. It looks like the reason being that the iotHubConnectionString is not able to get proper URL for http request. All other classes tries to use 'hostname'(which is set), but in this particular case it tries to use deviceId to derive the url while the iotHubConnectionString is not initialized.
ranjith-t
changed the title
[Bug Report] TwinClient replace mthod does not work with AzureSasCredential
[Bug Report] TwinClient replace method does not work with AzureSasCredential
Jan 16, 2023
Hi @ranjith-t, thanks for bringing this to our attention! The fix has been merged in and I will update here again once we release a newer version including it.
Context
Description of the issue
When device twin replace was requested through TwinClient class, it does not update the twin when AzureSasCredential is used for connection. At the IotHub, neither update of device twin nor there is any exception from TwinClient.
Code sample exhibiting the issue
TwinClient method replace() does not work when the TwinClient uses AzureSasCredential. It looks like the reason being that the iotHubConnectionString is not able to get proper URL for http request. All other classes tries to use 'hostname'(which is set), but in this particular case it tries to use deviceId to derive the url while the iotHubConnectionString is not initialized.
URL url; if (twin.getModuleId() == null || twin.getModuleId().length() == 0) { url = this.iotHubConnectionString.getUrlTwin(twin.getDeviceId()); } else { url = this.iotHubConnectionString.getUrlModuleTwin(twin.getDeviceId(), twin.getModuleId()); }
Console log of the issue
The text was updated successfully, but these errors were encountered: