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

PS C:\>$appgw = Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgName
PS C:\>$identity = New-AzUserAssignedIdentity -Name $identityName -ResourceGroupName $rgName -Location $location
PS C:\>$appgwIdentity = Set-AzApplicationGatewayIdentity -UserAssignedIdentity $identity.Id -ApplicationGateway $appgw
PS C:\>$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
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSApplicationGateway

String

Outputs

PSApplicationGateway