Modifier

Partager via


New-AzRedisCacheAccessPolicyAssignment

Add an Access Policy Assignment (Redis User) to the Redis Cache

Syntax

New-AzRedisCacheAccessPolicyAssignment
   [-ResourceGroupName <String>]
   -Name <String>
   -AccessPolicyAssignmentName <String>
   -AccessPolicyName <String>
   -ObjectId <String>
   -ObjectIdAlias <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRedisCacheAccessPolicyAssignment
   -TopLevelResourceObject <RedisCacheAttributes>
   -AccessPolicyAssignmentName <String>
   -AccessPolicyName <String>
   -ObjectId <String>
   -ObjectIdAlias <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create an access policy assignment (redis user) for a Redis Cache.

Examples

Example 1

New-AzRedisCacheAccessPolicyAssignment -Name "testCache" -AccessPolicyAssignmentName "testAccessPolicyAssignmentName" -AccessPolicyName "testAccessPolicyName" -ObjectId "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb" -ObjectIdAlias "testAlias"

This command creates access policy assignment (redis user) named testAccessPolicyAssignmentName on Redis Cache named testCache.

Parameters

-AccessPolicyAssignmentName

Name of Access Policy Assignment being added to the cache.

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

-AccessPolicyName

Name of Access Policy.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
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

-Name

Name of redis cache.

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

-ObjectId

Name of Object Id.

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

-ObjectIdAlias

Name of Object Id Alias.

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

-ResourceGroupName

Name of resource group under which cache exists.

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

-TopLevelResourceObject

Object of type RedisCacheAttributes

Type:RedisCacheAttributes
Position:Named
Default value:None
Required:True
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:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

RedisCacheAttributes

Outputs

PSRedisAccessPolicyAssignment