New-​Azure​Managed​Cache​Access​Key

Creates access keys for an Azure Cache.

Syntax

New-AzureManagedCacheAccessKey
   [-KeyType <String>]
   -Name <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The New-AzureManagedCacheAccessKey cmdlet creates primary or secondary access keys for an Azure Cache. When you create an Azure Cache, it includes a set of access keys. Use the Get-AzureManagedCacheAccessKey cmdlet to get the current access keys. You can use these keys to allow clients, such as web applications, to access to your Azure Cache. An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/).

Examples

Example 1: Create a new primary key

PS C:\>New-AzureManagedCacheAccessKey -Name "ContosoCache"

This command creates a new primary key for the Azure Cache named ContosoCache.

Example 2: Create a new secondary key

PS C:\>New-AzureManagedCacheAccessKey -Name "ContosoCache" -KeyType Secondary

This command creates a new secondary key for the Azure Cache named ContosoCache.

Example 3: Create new access keys

PS C:\>'Primary', 'Secondary' | ForEach-Object {New-AzureManagedCacheAccessKey -Name "ContosoCache" -KeyType $_}

This command creates new primary and secondary keys for the Azure Cache named ContosoCache.

Required Parameters

-Name

Specifies the name of Azure Cache access key to generate keys. The parameter value is case-sensitive. Wildcard characters are not permitted.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-KeyType

Specifies the type of key to create. The default value is Primary. You generally will use the primary key, but use the secondary key to avoid delays while the primary key is regenerated. The acceptable values for this parameter are:- Primary

  • Secondary
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

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

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

Inputs

None

Outputs

Microsoft.Azure.Management.ManagedCache.Models.CachingKeysResponse