Pankaj Garg
Pankaj Garg

Reputation: 51

How can i get the connection string for IoT hub in Azure Digital Twin

Resource only return following object and not connection string which I need to call Direct methods on device.

[{"id":"585302d5-f4c9-4248-bb50-482657c028ba","spaceId":"b27f5aa2-ba06-4ffa-9750-b4a3655a6096","type":"IotHub","isExternallyCreated":false,"status":"Running","lastUpdatedUtc":"2019-02-21T10:22:00.0456407","properties":{"iothubUrl":"ih-46de7654-b8c5-4ddc-9e50-b455d36d4146-1.azure-devices.net"},"instanceNum":1}]

Upvotes: 1

Views: 386

Answers (2)

Daniel Escapa MSFT
Daniel Escapa MSFT

Reputation: 56

Currently Azure Digital Twins doesn't support command & control to devices. You can get the device connection string but you cannot get the IoT Hub's connection string to issue commands (or device twins).

Moving forward we have heard a lot of feedback from customers that they want/need to send commands and in the next set of updates to Digital Twins we are looking at how to enable this. Stay tuned as we will have updates later in 2019. Thanks for the interest & question.

Upvotes: 1

Tyler Angell
Tyler Angell

Reputation: 151

The connectionString can only be retrieved from the devices endpoint.

GET https://{{instanceName}}.{{regionName}}.azuresmartspaces.net/management/api/v1.0/devices?includes=ConnectionString

In the early preview version of Digital Twins Command and Control is not available.

Upvotes: 2

Related Questions