Is there a way to know if IoT hub quota exceed WITHOUT data ingestion?

Mohammad Ajmal Yazdani 391 Reputation points
2022-07-11T09:29:48.493+00:00

Hi All,

I have below code which give me a nice exception about IoT quota exceeded while I am ingesting data to IOT hub, but does C# sdk has any method which gives me a way to find out that quota is out for a day WITH OUT data ingestion?

219417-image.png

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
393 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 31,211 Reputation points MVP
    2022-07-12T08:41:34.363+00:00

    Hello @Mohammad Ajmal Yazdani ,

    the API solution mentioned by @QuantumCache is the correct one.

    A coding example of this API call is found here.

    This will return both the current number and daily maximum:

    219804-image.png

    2 people found this answer helpful.
    0 comments No comments

  2. QuantumCache 20,261 Reputation points
    2022-07-11T23:25:34.967+00:00

    Hello @Mohammad Ajmal Yazdani thanks for posting the query on this forum.

    Iot Hub Resource - Get Quota Metrics

    Get the quota metrics for an IoT hub: This is a synchronous operation. The response contains a JSON-serialized array of the quota metrics for the IoT hub.

    GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics?api-version=2018-04-01  
    

    Same question on SO: https://stackoverflow.com/questions/72936389/is-there-a-way-to-know-if-iot-hub-quota-exceed-without-data-ingestion