Editar

Partilhar via


Set-AzApplicationGatewayIdentity

Updates a identity assigned to the application gateway.

Syntax

Set-AzApplicationGatewayIdentity
   -ApplicationGateway <PSApplicationGateway>
   -UserAssignedIdentityId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzApplicationGatewayIdentity cmdlet updates an identity assigned to application gateway.

Examples

Example 1

$appgw = Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgName
$identity = New-AzUserAssignedIdentity -Name $identityName -ResourceGroupName $rgName -Location $location
$appgwIdentity = Set-AzApplicationGatewayIdentity -UserAssignedIdentity $identity.Id -ApplicationGateway $appgw
$updatedAppGw = Set-AzApplicationGateway -ApplicationGateway $appgw

In this example, we assign a user assigned identity to an existing application gateway. Note: This identity should have access to the keyvault from which the certificates/secrets will be referenced.

Parameters

-ApplicationGateway

The applicationGateway

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

-UserAssignedIdentityId

ResourceId of the user assigned identity to be assigned to Application Gateway.

Type:String
Aliases:UserAssignedIdentity
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

PSApplicationGateway

String

Outputs

PSApplicationGateway