Skip to content

Conversation

@jackpoz
Copy link
Contributor

@jackpoz jackpoz commented Oct 25, 2025

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #5129

What is in this Pull Request ?

Allow to call Register-PnPEntraIDApp with a certificate without private key, so .cer instead of .pfx .
The private key is not needed when uploading a certificate to an app registration in Entra ID.

Here's the behavior with the PR:
image

The app registration works fine, see below a test case (notice how the pfx is used in this case with Connect-PnPOnline) :
image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the private key validation check when using an existing certificate with the Register-PnPAzureADApp cmdlet. The removed code ensured that certificates provided via the -CertificatePath parameter contain a private key before proceeding with app registration.

  • Removes the HasPrivateKey validation check for certificates loaded from a file path
  • Eliminates the associated error message that would inform users when their certificate lacks a private key

@NishkalankBezawada NishkalankBezawada merged commit 074bc0d into pnp:dev Oct 31, 2025
3 checks passed
@NishkalankBezawada
Copy link
Collaborator

Hey thanks @jackpoz, Merged it.

//Nish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Use Register-PnPEntraIdApp with CER file instead of PFX file

2 participants