An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
Hello @Anonymous ,
welcome to this moderated Azure community forum.
You want to distribute secrets to an Azure IoT Edge custom module.
These secrets are stored in an Azure keyvault.
The usual way to provide parameters to a module is making use of desired properties, part of the module twin.
The desired properties is a JSON structure and once updated in the cloud for a certain module in a certain device, it is picked up by the module (and a copy is stored in the EdgeHub for offline purposes) when a change is detected.
The device module can return a reported property in exchange to indicate the parameters is received.
Having these parameters distributed this way makes the data transmission lean and it supports offline scenarios. You also only need access to the IoT hub, other Azure resources (like a keyvault) do not need a public endpoint.
You want want to distribute secrets.
By default, the module twin is accessible by admins in the azure admin portal.
But you could also implement a custom flow and let the module ask for secrets by sending out a 'marked' message (eg having a specific application property (other than a system property)) so the IoT Hub routing could route the message to some logic (like an Azure Function).
Using the desired properties for distributing secrets with limited usages is a good idea because then offline support is still implemented.
I have used this to provide access to Azure Storage containers by creating a SAS token (which have a limited use in access and time). See this blog post with the example.
I'm not sure if Azure Keyvault supports SAS tokens (see this documentation) but a simular approach could work with any secret database...
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.