Get Azure IoT Hub metric using the connection string

95504669 546 Reputation points
2023-07-20T06:46:07.0866667+00:00

Hi,
How do we get the Azure IoT Hub metric info using the connection string?
Is there any sample available for it.? All we could find was methods of using .Net.
But we want to using connection string to keep it simple as possible. Please let us know on it. Thank you.

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,198 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
222 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 32,736 Reputation points MVP
    2023-07-20T12:03:31.7766667+00:00

    Hello @95504669,

    Yes, the IoT Hub comes with a REST API.

    Here is an (older) example of how to make a call using the API. You first need to create bearer token.

    There are a couple of metrics available (like `number of incoming messages, number of devices) but this is probably a limited set.

    The Azure IoT Hub Service SDK is a wrapper around the SDK and takes a lot of effort away.

    It's recommended to work with the SDK.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


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.