Update-AzADServicePrincipal

Updates an existing azure active directory service principal.

Warning

There are upcoming breaking changes in this cmdlet. These changes are currently in preview with Az.Resources version 5.0.0-preview. They will become generally available with our next major release of the Az PowerShell module, version 7.x in December of 2021. For more information, see Azure AD to Microsoft Graph migration changes in Azure PowerShell.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

Update-AzADServicePrincipal
      -ObjectId <String>
      [-DisplayName <String>]
      [-Homepage <String>]
      [-IdentifierUri <String[]>]
      [-KeyCredential <KeyCredential[]>]
      [-PasswordCredential <PasswordCredential[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzADServicePrincipal
      -ApplicationId <Guid>
      [-Homepage <String>]
      [-IdentifierUri <String[]>]
      [-KeyCredential <KeyCredential[]>]
      [-PasswordCredential <PasswordCredential[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzADServicePrincipal
      -ServicePrincipalName <String>
      [-DisplayName <String>]
      [-Homepage <String>]
      [-IdentifierUri <String[]>]
      [-KeyCredential <KeyCredential[]>]
      [-PasswordCredential <PasswordCredential[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzADServicePrincipal
      -InputObject <PSADServicePrincipal>
      [-DisplayName <String>]
      [-Homepage <String>]
      [-IdentifierUri <String[]>]
      [-KeyCredential <KeyCredential[]>]
      [-PasswordCredential <PasswordCredential[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Updates an existing azure active directory service principal. To update the credentials associated with this service principal, please use New-AzADSpCredential cmdlet. To update the properties associated with the underlying application, please use Update-AzADApplication cmdlet.

Examples

Example 1: Update the display name of a service principal

PS C:\> Update-AzADServicePrincipal -ObjectId 784136ca-3ae2-4fdd-a388-89d793e7c780 -DisplayName MyNewDisplayName

Updates the display name of the service principal with object id '784136ca-3ae2-4fdd-a388-89d793e7c780' to be 'MyNewDisplayName'.

Example 2: Update the display name of a service principal using piping

PS C:\> Get-AzADServicePrincipal -ObjectId 784136ca-3ae2-4fdd-a388-89d793e7c780 | Update-AzADServicePrincipal -DisplayName MyNewDisplayName

Gets the service principal with object id '784136ca-3ae2-4fdd-a388-89d793e7c780' and pipes that to the Update-AzADServicePrincipal cmdlet to update the display name of the service principal to "MyNewDisplayName".

Example 3

Updates an existing azure active directory service principal. (autogenerated)

Update-AzADServicePrincipal -IdentifierUri https://mySecretApp1 -ObjectId 00000000-0000-0000-0000-00000000000000000

Parameters

-ApplicationId

The application id of the service principal to update.

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

The display name for the service principal.

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

The homepage for the service principal.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IdentifierUri

The identifier URI(s) for the service principal.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

The object representing the service principal to update.

Type:PSADServicePrincipal
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-KeyCredential

The key credential(s) for the service principal.

Type:Microsoft.Azure.Graph.RBAC.Models.KeyCredential[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ObjectId

The object id of the service principal to update.

Type:String
Aliases:ServicePrincipalObjectId
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-PasswordCredential

The password credential(s) for the service principal.

Type:Microsoft.Azure.Graph.RBAC.Models.PasswordCredential[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServicePrincipalName

The SPN of the service principal to update.

Type:String
Aliases:SPN
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Guid

PSADServicePrincipal

Outputs

PSADServicePrincipal