< Back

Get-AzureRmStorageAccountKey

Tue Jan 29, 2019 10:11 pm

NAME Get-AzureRmStorageAccountKey



SYNOPSIS

Gets the access keys for an Azure Storage account.





SYNTAX

Get-AzureRmStorageAccountKey [-ResourceGroupName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]





DESCRIPTION

The Get-AzureRmStorageAccountKey cmdlet gets the access keys for an Azure Storage account.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the Storage account for which this cmdlet gets keys.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group that contains the Storage account.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Management.Storage.Models.StorageAccountKey







NOTES









Example 1: Get the access keys for a Storage account



PS C:\\>Get-AzureRmStorageAccountKey -ResourceGroupName "RG01" -AccountName "mystorageaccount"



This command gets the keys for the specified Azure Storage account.





Example 2: Get a specific access key for a Storage account



This command gets a specific key for a Storage account. This command works for Azure PowerShell version 1.4, and later versions.

PS C:\\>(Get-AzureRmStorageAccountKey -ResourceGroupName "RG01" -AccountName "mystorageaccount").Value[0]



This command gets a specific key for a Storage account. This command works for Azure PowerShell version 1.3.2, and previous versions.

PS C:\\>(Get-AzureRmStorageAccountKey -ResourceGroupName "RG01" -AccountName "mystorageaccount").Key1











RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... accountkey

New-AzureRmStorageAccountKey