Azure, Azure IOTHub, Connected Field Service, Dynamics 365 Field Services, Logic Apps, Microsoft Dynamics 365

Get Device ConnectionString from IOTHub using LogicApp

As of today, there are 3 connectors to Azure IOT Hub:

5.JPG

I recently had a requirement to get the Device Connectionstring from IOTHub using DeviceId and IOT Hub connectionstring.

The solution comprised of following 2 items:

  1.  Custom connector to get Device Connectionstring
    1. This is a Web api deployed on Azure which has a Post method, takes in DeviceId and IOTHub connectionstring and returns Device Connectionstring using Azure IOTHub sdk.
    2.  HTTP + Swagger action was used in Logic app to consume this.
  2.  Logic app wrapper which was consumed by other apps.

If you want to use the Connector, consume the following swagger file:

https://getdeviceidconnector.azurewebsites.net/swagger/docs/v1

 

Here’s the logic app definition:

https://www.dropbox.com/s/cc86kk3co6wdmuv/GetIOTHubDeviceConnectionString.txt?dl=0

 

 

 

 

 

 

 

Advertisements
Standard