Faster way of getting iot device Shared Access Keys in Azure IoT Hub?

TimM 26 Reputation points
2021-07-26T19:10:13.197+00:00

We're looking to be able to retrieve a large number of IoT device access keys. We haven't been able to find a way to do this in any sort of reasonable timeframe.

Things we have tried:

  • Get-AzIotHubDeviceConnectionString call for each device. This takes 2 - 3 seconds per device and isn't feasible for our use case.
  • Get-AzIotHubDeviceConnectionString call for "all" devices (that is, without specifying a deviceid). It has a limitation of 1000 results, and even if there is a way to work around this, it still can take almost 10 minutes to receive the results.
  • Using 'az iot hub device-identity connection-string show' had similar response times to Get-AzIotHubDeviceConnectionString.

Does anyone know of a way to retrieve shared access keys for iot devices in a short period of time?

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
399 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,189 questions
{count} votes

Accepted answer
  1. jlian-MSFT 101 Reputation points Microsoft Employee
    2021-07-27T17:22:57.897+00:00
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.