I can invoke device methods using ServiceClient (Microsoft.Azure.Devices.ServiceClient) from a function app in azure. That require IoTHubConnectionString being directly used when building the ServiceClient. However, this is the wrong approach because I provision devices using Device Provisioning Service using group enrollment therefore, I should not use the IoTHubConnectionString directly to build ServiceClient rather, I should be getting the IoTHubConnectionString from Device Provisioning Service Client (Microsoft.Azure.Devices.Provisioning.Service). Because, I would not know in which IoTHub the device is enrolled to.
I saw few examples where I can get the AssignedHub from Device Provisioning Service Client but do not know how to build a ServiceClient from the AssignedHub.
I successfully got the AssignedHub from DPS Service Client but failing to get IotHubConnectionString or a ServiceClient (Microsoft.Azure.Devices.ServiceClient), so that I can invoke Device Methods from my Function app.