New-CertKitAppProxyIdentity

2.0.1

This script configures everything CertKit needs to deploy certificates to Microsoft Entra Application Proxy applications, following least privilege. It supports three authentication methods. Starting with version 2.0, certificate authentication is the default. Use -UseClientSecret for client secret authentication.

Certificate authentication (default):
- A dedicated a
This script configures everything CertKit needs to deploy certificates to Microsoft Entra Application Proxy applications, following least privilege. It supports three authentication methods. Starting with version 2.0, certificate authentication is the default. Use -UseClientSecret for client secret authentication.

Certificate authentication (default):
- A dedicated app registration and service principal for CertKit.
- A self-signed certificate (RSA 2048, SHA256) with the subject 'CN=CertKit App Proxy Agent' and no subject alternative names, created in the local computer's personal store (Cert:\LocalMachine\My). The private key is non-exportable and is created in the TPM when one is available, otherwise by the Microsoft Software Key Storage Provider.
- The certificate has the Client Authentication EKU, or a custom EKU under your organization's IANA private enterprise number (PEN) when -CustomEku is specified.
- The public certificate is uploaded to the app registration, named 'CertKit Agent - <computer name>' so each server's certificates can be told apart.
- The script must run elevated on the server running the CertKit agent, because the private key can't leave the computer it was created on.

Client secret authentication (-UseClientSecret):
- A dedicated app registration and service principal for CertKit.
- A client secret, which is copied to the clipboard and never displayed on screen.

Managed identity authentication (-ManagedIdentityId):
- Uses an existing user-assigned or system-assigned managed identity attached to the server running the CertKit agent. The script doesn't create the managed identity, which is an Azure resource.

All methods:
- A custom Entra role that can only read Application Proxy settings and update the Application Proxy SSL certificate.
- The read-only Microsoft Graph application permission Application.Read.All, used by CertKit to find App Proxy applications.
- A tenant-wide assignment of the custom role to the CertKit identity, made directly or through Privileged Identity Management (PIM).

The script is safe to run more than once. Existing objects with the same names are reused, and existing role and permission assignments are not duplicated. A new certificate or client secret is created on every run. Expired certificates and client secrets are always removed from the app registration, and expired CertKit certificates are removed from the local computer's store. Use -RemoveExistingCertificates or -RemoveExistingSecrets to also remove older credentials that are still valid.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name New-CertKitAppProxyIdentity

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

Copyright (C) 2026 Richard M. Hicks Consulting, Inc. All Rights Reserved.

Package Details

FileList

Version History

Version Downloads Last updated
2.0.1 (current version) 12 12/2/2026
2.0 11 12/1/2026
1.4 10 11/24/2026
1.3 12 11/14/2026
1.2 10 11/14/2026
1.1 9 11/14/2026
Show more