-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Technical Question] How can we instantiate DeviceClient in the context of an Edge Module? #4978
Comments
Thanks for the question. I am going to add a couple of people from the Edge team, since this question could use knowledge of IoT Edge in providing the correct recommendation. |
@abhipsaMisra should we transfer this issue to the edge Github repo? It seems to be more of a question about edge runtime than about this SDK. |
Since the issue dealt with the different initialization methods available for device and module clients, I had kept this logged on our repository; but since this issue is completely Edge related, I don't see any issue in transferring it to the Edge repository. If any sdk related work item comes out of this, we can create a new issue on our repository. |
I don't have the right permissions to transfer this over to the Edge repository, @varunpuranik / @ancaantochi - is this something that you can answer here, or do you feel this would be better addressed on the Edge repo? |
Hello, If you are specifically not trying to include the ConnectionString, you can try using the other Create methods for deviceClient. There are IAuthenticationMethod implementations provided in the sdk, and a couple of abstract classes as well. Otherwise, I think your best bet is either the blob storage module or your #3, creating your own module to get around the persistence issue. You can pass in the secrets via module twin properties or you can store them on your edge device and load them from there. |
Thanks @dylanbronson - could you shed some light on why the |
Modules on edge uses the IdentityService (which is installed with iotedge) to provision the module. More details on the Identity Service: https://azure.github.io/iot-identity-service/ IoTHub has not implemented blob upload for modules, so the SDK and Edge can't either. I don't know the why behind this. I could guess that maybe that DeviceClients came first and, since then, there hasn't been an ask for ModuleClients to specifically. I can do some investigation and get back to you if I turn anything up. |
This issue is being marked as stale because it has been open for 30 days with no activity. |
@dylanbronson We plan on using the DPS with X509 certs - can the DPS certificates be used with the DeviceAuthenticationWithX509Certificate to authenticate the DeviceClient? |
We would like to make use of the file upload feature provided by the IoT Hub. Namely automatic management of storage SAS tokens and upload notifications.
Unfortunately you need a
DeviceClient
instance and that seems to be very hard to correctly instantiate in a edge module context. In particular pretty much all examples you find out there omit the hard part that is "put your connection string here".Options we have looked into
DeviceClient
via connection string - well, hard-coding is not an option and passing it via a module twin prop is just slightly less bad.So being able to instantiate a
DeviceClient
from the environment without having to hard-code/configure any account secrets seems like a way to make it work but it's not obvious how.It's really very unfortunate that iotedge devices have seemingly been left hang out to dry while all the require infra to make this work nicely is all there.
The text was updated successfully, but these errors were encountered: