IoT Hub

Filters

Actions

Example Policies

This set of policies will mark all IoT Hubs for deletion in 7 days that have ‘test’ in name (ignore case), and then perform the delete operation on those ready for deletion.

policies:
  - name: mark-test-iothubs-for-deletion
    resource: azure.iothub
    filters:
      - type: value
        key: name
        op: in
        value_type: normalize
        value: test
     actions:
      - type: mark-for-op
        op: delete
        days: 7
  - name: delete-test-iothubs
    resource: azure.iothub
    filters:
      - type: marked-for-op
        op: delete
    actions:
      - type: delete

This policy will find all IoT Hubs with 1000 or more dropped messages over the last 72 hours and notify user@domain.com

policies:
  - name: notify-iothubs-dropping-messages
    resource: azure.iothub
    filters:
      - type: metric
        metric: d2c.telemetry.egress.dropped
        op: ge
        aggregation: total
        threshold: 1000
        timeframe: 72
     actions:
      - type: notify
        template: default
        priority_header: 2
        subject: IOT Hubs Dropping Messages
        to:
          - user@domain.com
        transport:
          - type: asq
            queue: https://accountname.queue.core.windows.net/queuename