Storage

Filters

Actions

Example Policies

This set of policies will mark all storage accounts 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-storage-for-deletion
    resource: azure.storage
    filters:
      - type: value
        key: name
        op: in
        value_type: normalize
        value: test
     actions:
      - type: mark-for-op
        op: delete
        days: 7
  - name: delete-test-storage
    resource: azure.storage
    filters:
      - type: marked-for-op
        op: delete
    actions:
      - type: delete

This policy will find all Storage Accounts with 100 or less transactions over the 72 hours and notify user@domain.com

policies:
  - name: notify-storage-dropping-messages
    resource: azure.storage
    filters:
      - type: metric
        metric: Transactions
        op: le
        aggregation: total
        threshold: 100
        timeframe: 72
     actions:
      - type: notify
        template: default
        priority_header: 2
        subject: Inactive Storage Account
        to:
          - user@domain.com
        transport:
          - type: asq
            queue: https://accountname.queue.core.windows.net/queuename