Modifier

Partager via


New-AzRedisCacheKey

Regenerates the access key of a Redis Cache.

Syntax

New-AzRedisCacheKey
   [-ResourceGroupName <String>]
   -Name <String>
   -KeyType <String>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzRedisCacheKey cmdlet regenerates the access key of an Azure Redis Cache.

Examples

Example 1: Regenerate a primary key

New-AzRedisCacheKey -ResourceGroupName "ResourceGroup03" -Name "myCache" -KeyType "Primary" -Force

PrimaryKey        : ******
          SecondaryKey      : ******

This command regenerates the primary key of a Redis Cache.

Example 2: Regenerate a secondary key

New-AzRedisCacheKey -ResourceGroupName "ResourceGroup03" -Name "myCache" -KeyType "Secondary" -Force

PrimaryKey        : ******
          SecondaryKey      : ******

This command regenerates the secondary key of a Redis Cache.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyType

Specifies whether to regenerate the primary or secondary access key. Valid values are: Primary, Secondary.

Type:String
Accepted values:Primary, Secondary
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the Redis Cache.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specifies the name of the resource group that contains the Redis Cache.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

RedisAccessKeys