New-EntraApplicationKey

Adds a new key to an application.

Syntax

New-EntraApplicationKey
    -ObjectId <String>
    -KeyCredential <KeyCredential>
     -PasswordCredential <PasswordCredential>]
    -Proof <String>
   [<CommonParameters>]

Description

Adds a new key to an application.

Examples

Example 1: Add a key credential to an application

Connect-Entra -Scopes 'Application.ReadWrite.All' #Delegated Permission
Connect-Entra -Scopes 'Application.ReadWrite.OwnedBy' #Application Permission

$params = @{
    ObjectId = 'cccccccc-8888-9999-0000-dddddddddddd'
    KeyCredential = @{ key=[System.Convert]::FromBase64String("{base64cert}") }
    PasswordCredential = @{ DisplayName = 'mypassword' }
    Proof = "{token}"
}

New-EntraApplicationKey @params

This command adds a key credential the specified application.

Parameters

-KeyCredential

The application key credential to add.

NOTES: keyId value should be null.

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

-ObjectId

The unique identifier of the object specific Microsoft Entra ID object

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

-PasswordCredential

The application password credential to add.

NOTES: keyId value should be null.

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

-Proof

A signed JWT token used as a proof of possession of the existing keys.

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

Inputs

String

Microsoft.Open.MSGraph.Model.KeyCredential

Microsoft.Open.MSGraph.Model.PasswordCredential

Outputs

Microsoft.Open.MSGraph.Model.KeyCredential