Scalable way to distribute device identities
Module clients can be instantiated by using..
ioTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);
However, there is no mechanism to instantiate a DeviceClient using environment variables. However, this involves loading a DeviceConnectionString on each device which is obviously not scalable.
This is particularly problematic for leaf devices which cannot easiliy use DPS.
For devices that can connect to IoT Hub directly, the Device Provisioning Service is the best way to distribute device identity. For leaf devices, do you need the individual device identity in the cloud? Have you considered using modules to represent leaf devices or an identity translation gateway scenario (https://docs.microsoft.com/en-us/azure/iot-edge/iot-edge-as-gateway)?