< Back

Get-AzureStorageKey

Wed Jan 30, 2019 5:45 pm

NAME Get-AzureStorageKey



SYNOPSIS

Returns the primary and secondary storage account keys for an Azure storage account.





SYNTAX

Get-AzureStorageKey [-StorageAccountName] <String> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>]

[<CommonParameters>]





DESCRIPTION

The Get-AzureStorageKey cmdlet returns an object with the Azure Storage account name, the primary account key, and the secondary account key of the

specified Azure storage account as properties.





PARAMETERS

-StorageAccountName <String>

Specifies the storage account name.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





To get help with Node.js, use the help node-dev command. For help with PHP extensions, use the help php-dev command.



-------------------------- Example 1: Get an object that contains primary and secondary storage keys --------------------------



PS C:\\>Get-AzureStorageKey -StorageAccountName "ContosoStore01"



This command gets an object with the primary and secondary storage keys for the ContosoStore01 storage account.

-------------------------- Example 2: Get the primary storage account key and store it in a variable --------------------------



PS C:\\>$ContosoStoreKey = (Get-AzureStorageKey -StorageAccountName "ContosoStore01").Primary



This command puts the primary storage account key for the ContosoStore01 storage account in the $ContosoStoreKey variable.



RELATED LINKS

Get-AzureStorageAccount

New-AzureStorageAccountSASToken

New-AzureStorageKey

Remove-AzureStorageAccount

Set-AzureStorageAccount