< Back

New-AzureRmStorageAccountKey

Tue Jan 29, 2019 10:11 pm

NAME New-AzureRmStorageAccountKey



SYNOPSIS

Regenerates a storage key for an Azure Storage account.





SYNTAX

New-AzureRmStorageAccountKey [-ResourceGroupName] <String> [-Name] <String> [-KeyName] {key1 | key2} [-DefaultProfile <IAzureContextContainer>]

[<CommonParameters>]





DESCRIPTION

The New-AzureRmStorageAccountKey cmdlet regenerates a storage key 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



-KeyName <String>

Specifies which key to regenerate. The acceptable values for this parameter are:



- key1



- key2



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the Storage account for which to regenerate a storage key.



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: Regenerate a storage key



PS C:\\>New-AzureRmStorageKey -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyName "key1"



This command regenerates a storage key for the specified Storage account.







RELATED LINKS

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

Get-AzureRmStorageAccountKey