Get-AzStorageAccountKey
Gets the access keys for an Azure Storage account.
Get-AzStorageAccountKey
[-ResourceGroupName] <String>
[-Name] <String>
[-ListKerbKey]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
The Get-AzStorageAccountKey cmdlet gets the access keys for an Azure Storage account.
Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount"
This command gets the keys for the specified Azure Storage account.
This command gets a specific key for a Storage account.
(Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount")| Where-Object {$_.KeyName -eq "key1"}
KeyName Value Permissions CreationTime
------- ----- ----------- ------------
key1 <KeyValue> Full
This command gets a specific key value for a Storage account.
(Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount")[0].Value
<KeyValue>
Example 3: Lists the access keys for a Storage account, include the Kerberos keys (if active directory enabled)
Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" -ListKerbKey
This command gets the keys for the specified Azure Storage account.
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Lists the Kerberos keys (if active directory enabled) for the specified storage account. Kerberos key is generated per storage account for Azure Files identity based authentication either with Microsoft Entra Domain Service (Microsoft Entra Domain Services) or Active Directory Domain Service (AD DS). It is used as the password of the identity registered in the domain service that represents the storage account. Kerberos key does not provide access permission to perform any control or data plane read or write operations against the storage account.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the Storage account for which this cmdlet gets keys.
Type: | String |
Aliases: | StorageAccountName, AccountName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of the resource group that contains the Storage account.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Azure PowerShell feedback
Azure PowerShell is an open source project. Select a link to provide feedback: