Get-AzStorageBlobByTag
Lists blobs in a storage account across containers, with a blob tag filter sql expression.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Get-AzStorageBlobByTag
-TagFilterSqlExpression <String>
[-MaxCount <Int32>]
[-ContinuationToken <BlobContinuationToken>]
[-GetBlobProperty]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[<CommonParameters>]
Description
The Get-AzStorageBlobByTag cmdlet lists blobs in a storage account across containers, with a blob tag filter sql expression.
Examples
Example 1: List all blobs match a specific blob tag, across containers.
PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -Context $ctx
AccountName: storageaccountname, ContainerName: containername1
Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId
---- -------- ------ ----------- ------------ ---------- ------------ --------- ---------
testblob False
testblob2 False
AccountName: storageaccountname, ContainerName: containername2
Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId
---- -------- ------ ----------- ------------ ---------- ------------ --------- ---------
testblob3 False
testblob4 False
This command lists all blobs in a storage accoun, which contains a tag with name "tag1" and value "value1".
Example 2: List blobs in a specific container and match a specific blob tag
PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression "@container='containername' AND ""tag1""='value1'" -Context $ctx
AccountName: storageaccountname, ContainerName: containername
Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId
---- -------- ------ ----------- ------------ ---------- ------------ --------- ---------
test1 False
test2 False
This command lists blobs in a container and match a specific blob tag.
Example 3: List all blobs match a specific blob tag, across containers, and get the blob properties.
PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -GetBlobProperty
AccountName: storageaccountname, ContainerName: containername1
Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId
---- -------- ------ ----------- ------------ ---------- ------------ --------- ---------
testblob BlockBlob 2097152 application/octet-stream 2020-07-23 09:35:02Z Hot False 2020-07-23T09:35:02.8527357Z *
testblob2 BlockBlob 1048012 application/octet-stream 2020-07-23 09:35:05Z Hot False 2020-07-23T09:35:05.2504530Z *
AccountName: storageaccountname, ContainerName: containername2
Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId
---- -------- ------ ----------- ------------ ---------- ------------ --------- ---------
testblob3 BlockBlob 100 application/octet-stream 2020-07-01 09:55:14Z Hot False 2020-07-01T09:55:14.6507341Z *
testblob4 BlockBlob 2024 application/octet-stream 2020-07-01 09:42:11Z Hot False 2020-07-01T09:42:11.4283807Z *
This command lists all blobs in a storage accoun, which contains a tag with name "tag1" and value "value1", and get the blob properties. Please note, to get blob properties with parameter -GetBlobProperty, each blob will need an addtional request, so the cmdlet runs show when there are many blobs.
Parameters
The client side maximum execution time for each request in seconds.
| Type: | Nullable<T>[Int32] |
| Aliases: | ClientTimeoutPerRequestInSeconds |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The total amount of concurrent async tasks. The default value is 10.
| Type: | Nullable<T>[Int32] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Azure Storage Context Object
| Type: | IStorageContext |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Continuation Token.
| Type: | BlobContinuationToken |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
As the blobs get by tag don't contain blob proeprties, specify tis parameter to get blob properties with an additional request on each blob.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The max count of the blobs that can return.
| Type: | Nullable<T>[Int32] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The server time out for each request in seconds.
| Type: | Nullable<T>[Int32] |
| Aliases: | ServerTimeoutPerRequestInSeconds |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Filters the result set to only include blobs whose tags match the specified expression. See details in https://docs.microsoft.com/en-us/rest/api/storageservices/find-blobs-by-tags#remarks.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |