Edit

Share via


New-EntraBetaApplicationKey

Adds a new key to an application.

Syntax

New-EntraBetaApplicationKey
   -ApplicationId <String>
   -KeyCredential <KeyCredential>
   -Proof <String>
   [-PasswordCredential <PasswordCredential>]
   [<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', 'Application.ReadWrite.OwnedBy'
$app = Get-EntraBetaApplication -Filter "DisplayName eq '<application-display-name>'"
$params = @{
    ApplicationId      = $app.Id
    KeyCredential      = @{ key = [System.Convert]::FromBase64String('{base64cert}') }
    PasswordCredential = @{ DisplayName = 'mypassword' }
    Proof              = '{token}'
}
New-EntraBetaApplicationKey @params

This command adds a key credential to an specified application.

  • -ApplicationId parameter specifies the unique identifier of an application.
  • -KeyCredential parameter specifies the application key credential to add.
  • -PasswordCredential parameter specifies the application password credential to add.
  • -Proof parameter specifies the signed JWT token used as a proof of possession of the existing keys.

Parameters

-ApplicationId

The unique identifier of the application object.

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

-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

-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