Edit

Share via


Get-AzStorageEncryptionScope

Get or list encryption scopes from a Storage account.

Syntax

AccountName (Default)

Get-AzStorageEncryptionScope
    [-ResourceGroupName] <String>
    [-StorageAccountName] <String>
    [-EncryptionScopeName <String>]
    [-MaxPageSize <Int32>]
    [-Filter <String>]
    [-Include <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

AccountObject

Get-AzStorageEncryptionScope
    -StorageAccount <PSStorageAccount>
    [-EncryptionScopeName <String>]
    [-MaxPageSize <Int32>]
    [-Filter <String>]
    [-Include <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzStorageEncryptionScope cmdlet gets or lists encryption scopes from a Storage account.

Examples

Example 1: Get a single encryption scope

Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName $scopename
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount

Name      State    Source             KeyVaultKeyUri
----      -----    ------             --------------
testscope Disabled Microsoft.Keyvault https://keyvalutname.vault.azure.net:443/keys/keyname

This command gets a single encryption scope.

Example 2: List all encryption scopes of a Storage account

Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount"


   ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount

Name      State    Source             KeyVaultKeyUri
----      -----    ------             --------------
testscope Disabled Microsoft.Keyvault https://keyvalutname.vault.azure.net:443/keys/keyname
scope2    Enabled  Microsoft.Storage

This command lists all encryption scopes of a Storage account.

Example 3: List all enabled encryption scopes of a Storage account with a max page size of 10 for each request

Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -MaxPageSize 10 -Include Enabled
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount

Name      State    Source             KeyVaultKeyUri
----      -----    ------             --------------
scope1    Enabled  Microsoft.Keyvault https://keyvalutname.vault.azure.net:443/keys/keyname
scope2    Enabled  Microsoft.Storage

This command lists all enabled encryption scopes of a Storage account, with a max page size of 10 encryption scopes included in each list response. If there are more than 10 encryption scopes to be listed, the command will still list all the encryption scopes, but with multiple requests sent and responses received.

Example 4: List all disabled encryption scopes with names starting with "test" of a Storage account

Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Include Disabled -Filter "startswith(name, test)"
ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount

Name          State      Source             KeyVaultKeyUri
----          -----      ------             --------------
testscope1    Disabled   Microsoft.Keyvault https://keyvalutname.vault.azure.net:443/keys/keyname
testscope2    Disabled   Microsoft.Storage

This command lists all disabled encryption scopes with names starting with "test" of a Storage account. The parameter "Filter" specifies the prefix of the encryption scopes listed, and it should be in format of "startswith(name, {prefixValue})".

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

-EncryptionScopeName

Azure Storage EncryptionScope name

Parameter properties

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

Parameter sets

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

-Filter

The filter of encryption scope name. When specified, only encryption scope names starting with the filter will be listed.

Parameter properties

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

Parameter sets

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

-Include

The filter of encryption scope name. When specified, only encryption scope names starting with the filter will be listed.

Parameter properties

Type:String
Default value:None
Accepted values:All, Enabled, Disabled
Supports wildcards:False
DontShow:False

Parameter sets

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

-MaxPageSize

The maximum number of encryption scopes that will be included in the list response

Parameter properties

Type:

Nullable<T>[Int32]

Default value:None
Supports wildcards:False
DontShow:False

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

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

PSStorageAccount

Outputs

PSEncryptionScope