Website logo
HomeGithubSlack
⌘K
Overview
Quick Start
Supported Services
Running CloudGraph in EKS
Compliance
Rules Engine
AWS
Querying AWS Data
AWS Policy Packs
Billing Data
Services
Azure
Querying Azure Data
Azure Policy Packs
Services
GCP
Querying GCP Data
GCP Policy Packs
Services
K8s
Querying Kubernetes Data
Services
Docs powered by Archbee
Azure
...
Services
Storage

Storage Blob

11min

Note: if you are running CloudGraph locally you can view the interactive, automatically generated documentation in either GraphQL Playground or Altair by clicking the docs button on the right-hand side of the screen. After reading the below information we highly suggest you use one of these tools to test your queries as they will autocomplete fields for you and let you know if your queries are valid before you even submit them.

Overview

You can currently query the following attributes and connections on an Azure Storage Blob

GraphQL
query {
  queryazureStorageBlob{
    id
    name
    type
    kind
    subscriptionId
    region
    resourceGroupId
    deleted
    snapshot
    versionId
    properties{
      createdOn
      lastModified
      etag
      contentLength
      contentType
      contentEncoding
      contentLanguage
      contentDisposition
      cacheControl
      blobSequenceNumber
      blobType
      leaseStatus
      leaseState
      leaseDuration
      copyId
      copyStatus
      copySource
      copyProgress
      copyCompletedOn
      copyStatusDescription
      serverEncrypted
      incrementalCopy
      destinationSnapshot
      deletedOn
      remainingRetentionDays
      accessTier
      accessTierInferred
      archiveStatus
      customerProvidedKeySha256
      encryptionScope
      accessTierChangedOn
      tagCount
      expiresOn
      isSealed
      rehydratePriority
      lastAccessedOn
      immutabilityPolicyExpiresOn
      immutabilityPolicyMode
      contentCRC64
      legalHold
    }
    isCurrentVersion
    hasVersionsOnly
    objectReplicationSourceProperties{
      id
      policyId
      rules{
        ruleId
        replicationStatus
      }
    }
    resourceGroup{
      id
      # Other fields and connections here...
    }
    storageContainer{
      id
      # Other fields and connections here...
    }
    
  }
}


Filtering

Get data for a single Azure Storage Blob key that you know the ID for:

GraphQL
query {
  getazureStorageBlob(id: "12345") {
    id
    # Other fields and connections here...
  }
}


Get data for all of the Storage Blobs in a certain Azure subscription:

GraphQL
query {
  queryazureStorageBlob(filter: { subscriptionId: { eq: "12345" } }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "subscriptionId" you can
# Filter based on any of the following attributes:

# id
# name
# type
# kind
# region
# resourceGroupId
# deleted
# snapshot
# versionId
# isCurrentVersion
# hasVersionsOnly

# And the following Dgraph filters can also be applied:

# has
# and
# or
# not
# regexp (regular expressions)

# fulltext filters

# alloftext
# anyoftext


Get data for all of the Storage Blobs that are NOT in a certain Azure subscription:

GraphQL
query {
  queryazureStorageBlob(filter: { not: { subscriptionId: { eq: "12345" } } }) {
    id
    # Other fields and connections here...
  }
}


Advanced Filtering

Get data for all of the Storage Blobs that are connected to a storageContainer:

GraphQL
query {
  queryazureStorageBlob(filter: { has: storageContainer }) {
    id
    # Other fields and connections here...
  }
}


Ordering

You can order the results you get back either asc or desc depending on your preference:

GraphQL
query {
  queryazureStorageBlob(order: { desc: name }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "name" you can filter
# Using "asc" or "desc" based on any of the following attributes:

# id
# subscriptionId
# type
# kind
# region
# resourceGroupId
# deleted
# snapshot
# versionId
# isCurrentVersion
# hasVersionsOnly


Only select and return the first two Storage Blobs that are found:

GraphQL
query {
  queryazureStorageBlob(first: 2, order: { desc: name }) {
    id
    # Other fields and connections here...
  }
}


Only select and return the first two Storage Blobs that are found, but offset by one so keys two & three are returned:

GraphQL
query {
  queryazureStorageBlob(first: 2, order: { desc: name }, offset: 1) {
    id
    # Other fields and connections here...
  }
}


Aggregation

Count the number of Storage Blobs across all scanned Azure subscriptions:

GraphQL
query {
  aggregateazureStorageBlob {
    count
    # Other fields and connections here...
  }
}

# Note that in addition to "count" you can request the
# Following min and max values based on attributes of your Storage Blobs:

# idMin
# idMax
# nameMin
# nameMax
# typeMin
# typeMax
# kindMin
# kindMax
# subscriptionIdMin
# subscriptionIdMax
# regionMin
# regionMax
# deletedMin
# deletedMax
# snapshotMin
# snapshotMax
# versionIdMin
# versionIdMax



Count the number of Storage Blobs in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:

GraphQL
query {
  aggregateazureStorageBlob(filter: { subscriptionId: { eq: "12345" } }) {
    count
    # Other fields and connections here...
  }
}


Examples

Find all of the Storage Blobs that are in the eastus region across all your accounts:

GraphQL
query {
  queryazureStorageBlob(filter: { region: { eq: "eastus" } }) {
    id
    # Other fields and connections here...
  }
}


Kitchen Sink

Putting it all together; get all data for all Storage Blobs across all regions for all scanned Azure subscriptions in a single query.

GraphQL
query {
  queryazureStorageBlob{
    id
    name
    type
    kind
    subscriptionId
    region
    resourceGroupId
    deleted
    snapshot
    versionId
    properties{
      createdOn
      lastModified
      etag
      contentLength
      contentType
      contentEncoding
      contentLanguage
      contentDisposition
      cacheControl
      blobSequenceNumber
      blobType
      leaseStatus
      leaseState
      leaseDuration
      copyId
      copyStatus
      copySource
      copyProgress
      copyCompletedOn
      copyStatusDescription
      serverEncrypted
      incrementalCopy
      destinationSnapshot
      deletedOn
      remainingRetentionDays
      accessTier
      accessTierInferred
      archiveStatus
      customerProvidedKeySha256
      encryptionScope
      accessTierChangedOn
      tagCount
      expiresOn
      isSealed
      rehydratePriority
      lastAccessedOn
      immutabilityPolicyExpiresOn
      immutabilityPolicyMode
      contentCRC64
      legalHold
    }
    isCurrentVersion
    hasVersionsOnly
    objectReplicationSourceProperties{
      id
      policyId
      rules{
        ruleId
        replicationStatus
      }
    }
    resourceGroup{
      id
      # Other fields and connections here...
    }
    storageContainer{
      id
      # Other fields and connections here...
    }
    
  }
}


References

Dgraph documentation on querying

Azure Storage Blob Documentation

Updated 03 Mar 2023
Did this page help you?
PREVIOUS
Storage Account
NEXT
Storage Container
Docs powered by Archbee
TABLE OF CONTENTS
Overview
Filtering
Advanced Filtering
Ordering
Aggregation
Examples
Kitchen Sink
References
Docs powered by Archbee