6.5.8 Microsoft Entra Application Proxy

Set up a client secret or managed identity to renew certificates on App Proxy custom domains.

The Microsoft Entra Application Proxy (Client Secret Auth) and Microsoft Entra Application Proxy (Managed Identity Auth) templates upload the certificate as a PFX to Application Proxy apps published on a custom domain. They use the Microsoft Graph API and differ only in how they sign in. Apps on the default msappproxy.net domain use Microsoft’s certificate and are skipped.

These templates are in beta. Application Proxy certificate settings exist only in the Microsoft Graph beta API, which Microsoft can change.

Requirements

  • A Windows agent host that can reach Microsoft Graph and Entra sign-in over HTTPS. The agent doesn’t need to run on an Application Proxy connector server.
  • The Microsoft Graph PowerShell authentication module, version 2.0 or later, installed for all users. The agent runs as Local System. Run this command in an elevated Windows PowerShell session on the agent host.

    Install-Module -Name Microsoft.Graph.Authentication -Scope AllUsers -Repository PSGallery -Force
    

    On Windows PowerShell the module needs .NET Framework 4.7.2 or later.

  • App Proxy apps published on a verified custom domain, with the external URL’s CNAME already pointing to msappproxy.net.
  • A deployment identity that can read applications and update App Proxy SSL certificates.

Choose a sign-in method

Template Signs in as Agent host
Microsoft Entra Application Proxy (Client Secret Auth) An app registration with a client secret Any Windows host
Microsoft Entra Application Proxy (Managed Identity Auth) The agent host’s Azure managed identity An Azure VM with a managed identity, or an Azure Arc-enabled server

Both templates upload the same certificate. Choose the sign-in method that fits your Windows server.

Set up client secret sign-in

Ask your Entra admin to create an app just for CertKit and grant it permission to renew App Proxy certificates. Follow Richard M. Hicks’s client secret walkthrough

  1. In CertKit, select Client Secret Auth. Enter the tenant ID, client ID, and client secret Value from your admin.
  2. Under App Proxy apps to update, enter one app that needs the new certificate and run the deployment. The new certificate thumbprint in the result confirms the update, even if the log warns about “no Microsoft Graph permission to update apps.”
For Entra admins setting up or switching roles

Grant admin consent for the Graph application permission Application.Read.All. Assign the custom App Proxy Certificate Manager role to the CertKit enterprise app at tenant scope. It can then renew App Proxy certificates across the tenant. The role uses three actions.

  • microsoft.directory/applications/applicationProxy/read
  • microsoft.directory/connectorGroups/allProperties/read
  • microsoft.directory/applications/applicationProxySslCertificate/update

Older setups use Application.ReadWrite.OwnedBy and require the identity to own each target app. If you switch, test the new identity with its two permissions before retiring the old CertKit grants or secret.

Set up managed identity sign-in

If you see “The managed identity could not get a token,” start with the Windows server running CertKit. Follow Richard M. Hicks’s managed identity walkthrough

In CertKit, select Managed Identity Auth. Fill in Managed identity for your server.

Server setup What to enter
Azure VM with its system-assigned identity enabled, or an Azure Arc server Leave system in the field.
Azure VM with a user-assigned identity attached Enter that identity’s client ID.
Other Windows server Choose client secret sign-in.

Ask your Entra admin to grant the identity the permissions in Richard’s guide. Deploy to one app that needs the renewal and look for the new certificate thumbprint. If sign-in succeeds but the update reports 403, ask the admin to check the certificate role.

Template variables

Client secret template

  • Entra tenant ID: the Directory (tenant) ID from the Overview page of the Entra admin center.
  • App registration (client) ID: the Application (client) ID of the app registration.
  • Client secret: the secret’s Value from Certificates & secrets, not its Secret ID. Client secrets expire. Create a new one and update this field before the old one runs out.

Managed identity template

  • Managed identity: leave as system to use the machine’s system-assigned identity. For a user-assigned identity, enter its client ID.

Both templates

  • App Proxy apps to update: leave * to update every App Proxy app whose external URL the certificate covers. Or list app display names or Application IDs, separated by commas.

With *, the template finds App Proxy apps through both the on-premises application template and the service principal tag that App Proxy apps carry. It skips apps on msappproxy.net, Global Secure Access (Private Access) apps, and apps whose external URL host the certificate doesn’t cover. A wildcard name covers one label, so *.example.com covers app.example.com but not app.hr.example.com. A wildcard app with an external URL like https://*.example.com/ needs a certificate with that same wildcard name.

With a list, each name must match exactly one app. If two apps share a display name, use the Application ID from the app’s Overview page. A listed app the certificate doesn’t seem to cover gets a warning, and the template still tries the upload.

What happens on each run

  1. Opens the PFX with its password file. Stops if the PFX has no private key, or if the certificate is expired or not yet valid. Warns if the PFX holds no intermediate certificates, or if the password has characters other than letters and digits.
  2. Signs in to Microsoft Graph and logs the identity’s Graph permissions. Warns if it has none that can update apps.
  3. Finds the apps to update, as described above.
  4. For each app, skips it if Entra already reports this certificate’s thumbprint. Otherwise it uploads the PFX and password, then checks the app every 3 seconds, for up to a minute, until Entra reports the new thumbprint.
  5. Reports how many apps were updated and how many already had the certificate. If any app failed, the run fails and lists each failed app with the reason. Apps that succeeded stay updated.
  6. Signs out of Microsoft Graph and clears the key material from memory.

Disruption and rollback

The upload doesn’t restart anything, and connector servers are not touched. Entra starts serving the new certificate one to two minutes after the upload. During that window, new connections can get the old certificate, Microsoft’s msappproxy.net certificate, or the new one.

The template confirms the upload with Entra, but it doesn’t connect to the external URL to check the served certificate. Add the external URL to host monitoring for that.

There is no automatic rollback. Entra deletes old certificates that no app uses, so to go back, upload the previous PFX on the app’s Application proxy page.

Common problems

  • “The Microsoft Graph PowerShell module (Microsoft.Graph.Authentication) is not installed on this machine”: install it with -Scope AllUsers from an elevated prompt. A per-user install isn’t visible to Local System.
  • “version 2.0 or later is required”: update the module with the same install command.
  • “is installed but could not be loaded”: install .NET Framework 4.7.2 or later on the agent host.
  • “Could not sign in to Microsoft Graph”: the message names the Entra error. AADSTS7000215 means the secret is wrong, usually the Secret ID instead of the Value. AADSTS7000222 means the secret expired. AADSTS700016 means no app registration has that client ID in the tenant. AADSTS90002 or AADSTS900023 means the tenant ID is wrong.
  • “The managed identity could not get a token.” Check which identity CertKit should use on this server. Managed identity setup
  • “Could not list the tenant’s App Proxy apps.” Ask your Entra admin to grant Application.Read.All to the identity named in the log.
  • “No App Proxy apps were found in the tenant”: check that the identity signs in to the right tenant.
  • “No App Proxy app on a custom domain has an external URL covered by this certificate”: compare the names in the log’s “Covers” line with each app’s external URL. A wildcard covers one label.
  • “no app has this display name or Application ID” or “apps have this display name”: fix the name in App Proxy apps to update, or use the Application ID.
  • “not published through application proxy” or “published on the default msappproxy.net domain”: remove that app from the list. Only apps on a custom domain take your certificate.
  • “Microsoft Graph refused the update” (403, Authorization_RequestDenied). Sign-in worked. Ask your Entra admin to check the certificate role for the identity named in the log. Older setups require that identity to own the app. App Proxy permissions
  • “Entra says the certificate doesn’t cover”: the external URL host isn’t in the certificate. Add it to the certificate’s names in CertKit.
  • “Entra could not use the PFX”: the password or private key was rejected. Keep the PFX format the template selects and deploy again.
  • “Entra accepted the upload but still doesn’t report the new certificate after a minute”: check the app’s Application proxy page in the Entra admin center, then deploy again.

For a product overview, see certificate automation for Microsoft Entra Application Proxy.