Storage Account
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.
You can currently query the following attributes and connections on an Azure Storage Account
query { queryazureStorageAccount { id name type kind subscriptionId region resourceGroupId extendedLocationName extendedLocationType provisioningState primaryEndpoints{ blob queue table file web dfs } primaryMicrosoftEndpoints { blob queue table file web dfs } primaryInternetEndpoints{ blob file web dfs } primaryLocation statusOfPrimary lastGeoFailoverTime secondaryLocation statusOfSecondary customDomainName customDomainUseSubDomainName sasPolicyExpirationPeriod keyPolicyExpirationPeriodInDays keyCreationTimeKey1 keyCreationTimeKey2 encryptionServiceBlob{ enabled lastEnabledTime keyType } encryptionServiceFile{ enabled lastEnabledTime keyType } encryptionServiceTable{ enabled lastEnabledTime keyType } encryptionServiceQueue{ enabled lastEnabledTime keyType } encryptionKeySource encryptionRequireInfrastructureEncryption encryptionKeyVaultPropertyKeyName encryptionKeyVaultPropertyKeyVersion encryptionKeyVaultPropertyKeyVaultUri encryptionKeyVaultPropertyCurrentVersionedKeyIdentifier encryptionKeyVaultPropertyLastKeyRotationTimestamp encryptionUserAssignedIdentity accessTier azureFilesIdentityBasedAuthenticationDirectoryServiceOptions azureFilesIdentityBasedAuthenticationADProperties{ domainName netBiosDomainName forestName domainGuid domainSid azureStorageSid } enableHttpsTrafficOnly networkRuleSetByPass networkRuleResourceAccessRules { id tenantId resourceId } networkRuleVirtualNetworkRules { id virtualNetworkResourceId action state } networkRuleIpRules{ id iPAddressOrRange action } networkRuleSetDefaultAction isHnsEnabled geoReplicationStatsStatus geoReplicationStatsLastSyncTime geoReplicationStatsCanFailover failoverInProgress largeFileSharesState privateEndpointConnections{ id privateEndpointId privateLinkServiceConnectionStateStatus privateLinkServiceConnectionStateDescription privateLinkServiceConnectionStateActionRequired provisioningState } routingPreferenceChoice routingPreferencePublishMicrosoftEndpoints routingPreferencePublishInternetEndpoints allowBlobPublicAccess minimumTlsVersion allowSharedKeyAccess enableNfsV3 tags{ id key value } resourceGroup { id # Other fields and connections here... } storageContainers { id # Other fields and connections here... } appServiceWebApp { id # Other fields and connections here... } eventHubs { id # Other fields and connections here... } diagnosticSettings { id # Other fields and connections here... } fileShares { id # Other fields and connections here... } } }
Get data for a single Azure Storage Account key that you know the ID for:
query { getazureStorageAccount(id: "12345") { id # Other fields and connections here... } }
Get data for all of the Storage Accounts in a certain Azure subscription:
query { queryazureStorageAccount(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 # subscriptionId # region # resourceGroupId # extendedLocationName # extendedLocationType # provisioningState # primaryLocation # statusOfPrimary # lastGeoFailoverTime # secondaryLocation # statusOfSecondary # customDomainName # customDomainUseSubDomainName # sasPolicyExpirationPeriod # keyPolicyExpirationPeriodInDays # keyCreationTimeKey1 # keyCreationTimeKey2 # encryptionKeySource # encryptionRequireInfrastructureEncryption # encryptionKeyVaultPropertyKeyName # encryptionKeyVaultPropertyKeyVersion # encryptionKeyVaultPropertyKeyVaultUri # encryptionKeyVaultPropertyCurrentVersionedKeyIdentifier # encryptionKeyVaultPropertyLastKeyRotationTimestamp # encryptionUserAssignedIdentity # accessTier # azureFilesIdentityBasedAuthenticationDirectoryServiceOptions # enableHttpsTrafficOnly # networkRuleSetByPass # networkRuleSetDefaultAction # isHnsEnabled # geoReplicationStatsStatus # geoReplicationStatsLastSyncTime # geoReplicationStatsCanFailover # failoverInProgress # largeFileSharesState # routingPreferenceChoice # routingPreferencePublishMicrosoftEndpoints # routingPreferencePublishInternetEndpoints # allowBlobPublicAccess # minimumTlsVersion # allowSharedKeyAccess # enableNfsV3 # 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 Accounts that are NOT in a certain Azure subscription:
query { queryazureStorageAccount(filter: { not: { subscriptionId: { eq: "12345" } } }) { id # Other fields and connections here... } }
Get data for all of the Storage Accounts that are connected to an storageContainer:
query { queryazureStorageAccount(filter: { has: storageContainers }) { id # Other fields and connections here... } } # Note that in addition to "storageContainers" you can filter # Using "has" based on any of the following attributes: # id # name # type # kind # subscriptionId # region # resourceGroupId # extendedLocationName # extendedLocationType # provisioningState # primaryLocation # statusOfPrimary # lastGeoFailoverTime # secondaryLocation # statusOfSecondary # customDomainName # customDomainUseSubDomainName # sasPolicyExpirationPeriod # keyPolicyExpirationPeriodInDays # keyCreationTimeKey1 # keyCreationTimeKey2 # encryptionKeySource # encryptionRequireInfrastructureEncryption # encryptionKeyVaultPropertyKeyName # encryptionKeyVaultPropertyKeyVersion # encryptionKeyVaultPropertyKeyVaultUri # encryptionKeyVaultPropertyCurrentVersionedKeyIdentifier # encryptionKeyVaultPropertyLastKeyRotationTimestamp # encryptionUserAssignedIdentity # accessTier # azureFilesIdentityBasedAuthenticationDirectoryServiceOptions # enableHttpsTrafficOnly # networkRuleSetByPass # networkRuleSetDefaultAction # isHnsEnabled # geoReplicationStatsStatus # geoReplicationStatsLastSyncTime # geoReplicationStatsCanFailover # failoverInProgress # largeFileSharesState # routingPreferenceChoice # routingPreferencePublishMicrosoftEndpoints # routingPreferencePublishInternetEndpoints # allowBlobPublicAccess # minimumTlsVersion # allowSharedKeyAccess # enableNfsV3 # tags # resourceGroup # appServiceWebApp # eventHubs # diagnosticSettings # fileShares
You can order the results you get back either asc or desc depending on your preference:
query { queryazureStorageAccount(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 # type # kind # subscriptionId # region # resourceGroupId # extendedLocationName # extendedLocationType # provisioningState # primaryLocation # statusOfPrimary # lastGeoFailoverTime # secondaryLocation # statusOfSecondary # customDomainName # customDomainUseSubDomainName # sasPolicyExpirationPeriod # keyPolicyExpirationPeriodInDays # keyCreationTimeKey1 # keyCreationTimeKey2 # encryptionKeySource # encryptionRequireInfrastructureEncryption # encryptionKeyVaultPropertyKeyName # encryptionKeyVaultPropertyKeyVersion # encryptionKeyVaultPropertyKeyVaultUri # encryptionKeyVaultPropertyCurrentVersionedKeyIdentifier # encryptionKeyVaultPropertyLastKeyRotationTimestamp # encryptionUserAssignedIdentity # accessTier # azureFilesIdentityBasedAuthenticationDirectoryServiceOptions # enableHttpsTrafficOnly # networkRuleSetByPass # networkRuleSetDefaultAction # isHnsEnabled # geoReplicationStatsStatus # geoReplicationStatsLastSyncTime # geoReplicationStatsCanFailover # failoverInProgress # largeFileSharesState # routingPreferenceChoice # routingPreferencePublishMicrosoftEndpoints # routingPreferencePublishInternetEndpoints # allowBlobPublicAccess # minimumTlsVersion # allowSharedKeyAccess # enableNfsV3
Only select and return the first two Storage Accounts that are found:
query { queryazureStorageAccount(first: 2, order: { desc: name }) { id # Other fields and connections here... } }
Only select and return the first two Storage Accounts that are found, but offset by one so keys two & three are returned:
query { queryazureStorageAccount(first: 2, order: { desc: name }, offset: 1) { id # Other fields and connections here... } }
Count the number of Storage Accounts across all scanned Azure subscriptions:
query { aggregateazureStorageAccount { 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 Accounts: # idMin # idMax # nameMin # nameMax # typeMin # typeMax # kindMin # kindMax # subscriptionIdMin # subscriptionIdMax # regionMin # regionMax # resourceGroupIdMin # resourceGroupIdMax # extendedLocationNameMin # extendedLocationNameMax # extendedLocationTypeMin # extendedLocationTypeMax # provisioningStateMin # provisioningStateMax # primaryLocationMin # primaryLocationMax # statusOfPrimaryMin # statusOfPrimaryMax # lastGeoFailoverTimeMin # lastGeoFailoverTimeMax # secondaryLocationMin # secondaryLocationMax # statusOfSecondaryMin # statusOfSecondaryMax # customDomainNameMin # customDomainNameMax # customDomainUseSubDomainNameMin # customDomainUseSubDomainNameMax # sasPolicyExpirationPeriodMin # sasPolicyExpirationPeriodMax # keyPolicyExpirationPeriodInDaysMin # keyPolicyExpirationPeriodInDaysMax # keyPolicyExpirationPeriodInDaysSum # keyPolicyExpirationPeriodInDaysAvg # keyCreationTimeKey1Min # keyCreationTimeKey1Max # keyCreationTimeKey2Min # keyCreationTimeKey2Max # encryptionKeySourceMin # encryptionKeySourceMax # encryptionRequireInfrastructureEncryptionMin # encryptionRequireInfrastructureEncryptionMax # encryptionKeyVaultPropertyKeyNameMin # encryptionKeyVaultPropertyKeyNameMax # encryptionKeyVaultPropertyKeyVersionMin # encryptionKeyVaultPropertyKeyVersionMax # encryptionKeyVaultPropertyKeyVaultUriMin # encryptionKeyVaultPropertyKeyVaultUriMax # encryptionKeyVaultPropertyCurrentVersionedKeyIdentifierMin # encryptionKeyVaultPropertyCurrentVersionedKeyIdentifierMax # encryptionKeyVaultPropertyLastKeyRotationTimestampMin # encryptionKeyVaultPropertyLastKeyRotationTimestampMax # encryptionUserAssignedIdentityMin # encryptionUserAssignedIdentityMax # accessTierMin # accessTierMax # azureFilesIdentityBasedAuthenticationDirectoryServiceOptionsMin # azureFilesIdentityBasedAuthenticationDirectoryServiceOptionsMax # enableHttpsTrafficOnlyMin # enableHttpsTrafficOnlyMax # networkRuleSetByPassMin # networkRuleSetByPassMax # networkRuleSetDefaultActionMin # networkRuleSetDefaultActionMax # isHnsEnabledMin # isHnsEnabledMax # geoReplicationStatsStatusMin # geoReplicationStatsStatusMax # geoReplicationStatsLastSyncTimeMin # geoReplicationStatsLastSyncTimeMax # geoReplicationStatsCanFailoverMin # geoReplicationStatsCanFailoverMax # failoverInProgressMin # failoverInProgressMax # largeFileSharesStateMin # largeFileSharesStateMax # routingPreferenceChoiceMin # routingPreferenceChoiceMax # routingPreferencePublishMicrosoftEndpointsMin # routingPreferencePublishMicrosoftEndpointsMax # routingPreferencePublishInternetEndpointsMin # routingPreferencePublishInternetEndpointsMax # allowBlobPublicAccessMin # allowBlobPublicAccessMax # minimumTlsVersionMin # minimumTlsVersionMax # allowSharedKeyAccessMin # allowSharedKeyAccessMax # enableNfsV3Min # enableNfsV3Max
Count the number of Storage Accounts in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
query { aggregateazureStorageAccount(filter: { subscriptionId: { eq: "12345" } }) { count # Other fields and connections here... } }
Find all of the Storage Accounts that are in the eastus region across all your accounts:
query { queryazureStorageAccount(filter: { region: { eq: "eastus" } }) { id # Other fields and connections here... } }
Find all of the Storage Accounts that have a tag of Environment:Production for a single Azure Subscription:
query { queryazureTag( filter: { key: { eq: "Environment" }, value: { eq: "Production" } } ) { storageAccounts(filter: { subscriptionId: { eq: "12345" } }) { id # Other fields and connections here... } } }
With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:
query { queryazureStorageAccount(filter: { region: { eq: "eastus" } }) { id # Other fields and connections here... } queryazureTag( filter: { key: { eq: "Environment" }, value: { eq: "Production" } } ) { storageAccounts(filter: { subscriptionId: { eq: "12345" } }) { id # Other fields and connections here... } } }
Putting it all together; get all data for all Storage Accounts across all regions for all scanned Azure subscriptions in a single query. For the purposes of this example, we will only get direct children of the keys but if you want to it's easy to go from say, disk -> virtualMachine -> networkInterface ...etc:
query { queryazureStorageAccount { id name type kind subscriptionId region resourceGroupId extendedLocationName extendedLocationType provisioningState primaryEndpoints{ blob queue table file web dfs } primaryMicrosoftEndpoints { blob queue table file web dfs } primaryInternetEndpoints{ blob file web dfs } primaryLocation statusOfPrimary lastGeoFailoverTime secondaryLocation statusOfSecondary customDomainName customDomainUseSubDomainName sasPolicyExpirationPeriod keyPolicyExpirationPeriodInDays keyCreationTimeKey1 keyCreationTimeKey2 encryptionServiceBlob{ enabled lastEnabledTime keyType } encryptionServiceFile{ enabled lastEnabledTime keyType } encryptionServiceTable{ enabled lastEnabledTime keyType } encryptionServiceQueue{ enabled lastEnabledTime keyType } encryptionKeySource encryptionRequireInfrastructureEncryption encryptionKeyVaultPropertyKeyName encryptionKeyVaultPropertyKeyVersion encryptionKeyVaultPropertyKeyVaultUri encryptionKeyVaultPropertyCurrentVersionedKeyIdentifier encryptionKeyVaultPropertyLastKeyRotationTimestamp encryptionUserAssignedIdentity accessTier azureFilesIdentityBasedAuthenticationDirectoryServiceOptions azureFilesIdentityBasedAuthenticationADProperties{ domainName netBiosDomainName forestName domainGuid domainSid azureStorageSid } enableHttpsTrafficOnly networkRuleSetByPass networkRuleResourceAccessRules { id tenantId resourceId } networkRuleVirtualNetworkRules { id virtualNetworkResourceId action state } networkRuleIpRules{ id iPAddressOrRange action } networkRuleSetDefaultAction isHnsEnabled geoReplicationStatsStatus geoReplicationStatsLastSyncTime geoReplicationStatsCanFailover failoverInProgress largeFileSharesState privateEndpointConnections{ id privateEndpointId privateLinkServiceConnectionStateStatus privateLinkServiceConnectionStateDescription privateLinkServiceConnectionStateActionRequired provisioningState } routingPreferenceChoice routingPreferencePublishMicrosoftEndpoints routingPreferencePublishInternetEndpoints allowBlobPublicAccess minimumTlsVersion allowSharedKeyAccess enableNfsV3 resourceGroup{ id name type kind subscriptionId region managedBy disks { id # Other fields and connections here... } dns { id # Other fields and connections here... } firewalls { id # Other fields and connections here... } functionApps { id # Other fields and connections here... } keyVaults { id # Other fields and connections here... } networkInterfaces { id # Other fields and connections here... } publicIps { id # Other fields and connections here... } securityGroups { id # Other fields and connections here... } storageAccounts { id # Other fields and connections here... } storageContainers { id # Other fields and connections here... } virtualMachines { id # Other fields and connections here... } virtualMachineScaleSets{ id # Other fields and connections here... } virtualNetworks { id # Other fields and connections here... } tags{ id key value } } storageContainers{ id name type kind subscriptionId region resourceGroupId version deleted deletedTime remainingRetentionDays denyEncryptionScopeOverride publicAccess lastModifiedTime leaseStatus leaseDuration immutabilityPolicyPeriodSinceCreationInDays immutabilityPolicyState immutabilityPolicyAllowProtectedAppendWrites immutabilityPolicyUpdateHistory { id update immutabilityPeriodSinceCreationInDays timestamp objectIdentifier tenantId upn } legalHoldTags{ id tag timestamp objectIdentifier tenantId upn } hasLegalHold hasImmutabilityPolicy resourceGroup{ id # Other fields and connections here... } storageAccount{ id # Other fields and connections here... } } tags{ id key value } } }


