Edit

Share via


Get-AzStorageBlobInventoryPolicy

Gets blob inventory policy from a Storage account.

Syntax

AccountName (Default)

Get-AzStorageBlobInventoryPolicy
    [-ResourceGroupName] <String>
    [-StorageAccountName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

AccountResourceId

Get-AzStorageBlobInventoryPolicy
    [-StorageAccountResourceId] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

AccountObject

Get-AzStorageBlobInventoryPolicy
    -StorageAccount <PSStorageAccount>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzStorageBlobInventoryPolicy cmdlet gets blob inventory policy from a Storage account.

Examples

Example 1: Get blob inventory policy from a Storage account

$policy = Get-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount"

$policy

StorageAccountName : mystorageaccount
ResourceGroupName  : myresourcegroup
Name               : DefaultInventoryPolicy
Id                 : /subscriptions/{subscription-Id}/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/inventoryPolicies/default
Type               : Microsoft.Storage/storageAccounts/inventoryPolicies
LastModifiedTime   : 11/4/2020 9:18:30 AM
Enabled            : True
Rules              : {Test1, Test2}

$policy.Rules

Name  Enabled Destination   ObjectType Format  Schedule IncludeSnapshots IncludeBlobVersions BlobTypes               PrefixMatch SchemaFields
----  ------- -----------   ---------- ------  -------- ---------------- ------------------- ---------               ----------- ------------
Test1 False   containername Container  Csv     Daily                                                                 {aaa, bbb}  {Name, Metadata, PublicAccess, Last-Modified...}
Test2 True    containername Blob       Parquet Weekly   True             True                {blockBlob, appendBlob} {ccc, ddd}  {Name, Creation-Time, Last-Modified, Content-Length...}

This command gets blob inventory policy from a Storage account, and show its properties.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Resource Group Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AccountName
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageAccount

Storage account object

Parameter properties

Type:PSStorageAccount
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AccountObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageAccountName

Storage Account Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AccountName

Parameter sets

AccountName
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageAccountResourceId

Storage Account Resource Id.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AccountResourceId
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

PSStorageAccount

Outputs

PSBlobInventoryPolicy