Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Entra Client Secrets Security Guide: App Registration…
Guide Secrets Management

Azure Entra Client Secrets Security Guide: App Registration Secrets, Certificates and Policies

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 12 min read
On this page

A Microsoft Entra ID client secret is a password for an application, and whoever copies it can sign in as that application from anywhere, with every permission the app holds and no MFA to stop them. Client secrets are still the most common credential on app registrations because they are the easiest to create, and they end up in configuration files, pipeline variables and vendor platforms that hold access to your tenant. Microsoft's guidance is clear: do not use password secrets, prefer managed identities or workload identity federation, and use certificates where neither is possible. This guide covers how application credentials work in Entra ID, who can add them, how to restrict them with application management policies, how to detect misuse, and how to migrate away. It is for identity engineers, cloud platform teams and anyone reviewing Entra tenants. For consent, permissions and enterprise app governance, read the Entra ID Applications and Consent Guide; this page focuses on the credential itself.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • Credential order of preference: managed identity, then workload identity federation, then a certificate, and a client secret only as a time-boxed exception.
  • Anyone who can add a credential can become the app. App owners and the Application Administrator and Cloud Application Administrator roles can add secrets, so treat those assignments as privileged access.
  • Application management policies enforce it. "Block password addition" and "Restrict max password lifetime" stop new secrets or cap their life tenant-wide, with named exclusions.
  • Watch for new credentials on existing apps. Adding a secret to a privileged app (ATT&CK T1098.001 Additional Cloud Credentials) is a favourite persistence move and shows up in the audit log.
  • Vendor-held secrets are your risk too. A secret a SaaS provider keeps for your tenant is a privileged NHI outside your control; limit its permissions and its sign-in locations.

How identity and access work in Entra application credentials

Every app registration (the application object) can hold two kinds of credential, and its service principal in each tenant can hold them too. The app uses the credential in the OAuth 2.0 client credentials flow to obtain tokens with its application permissions, or alongside a user in delegated flows.

CredentialStored asStrengthMain risk
Client secretpasswordCredentialsLowest assurance: a shared string sent to the token endpointCopied from config, logs, pipelines or vendor systems; usable anywhere
CertificatekeyCredentials (public key only)Stronger: the private key never leaves the client, which signs an assertionPrivate key exported from a file system or certificate store
Federated identity credentialTrust in an external issuer and subjectNo stored secret; short-lived external token exchangedOver-broad subject claims or untrusted issuers
Managed identityAzure-managed, no credential exposedStrongest for workloads in AzureOver-permissioned identity on a compromised resource
  • Secret format: current Entra secrets contain the sequence Q~ after the first four characters, which is how scanners such as the Gitleaks azure-ad-client-secret rule find them.
  • Shown once: the secret value is displayed only when created. Teams that lose it create another rather than removing the old one, which is how apps accumulate several live secrets.
  • Lifetime: the portal offers preset expiry periods up to 24 months; longer lifetimes can be set through Microsoft Graph or PowerShell unless a policy stops it.
  • Two places to look: credentials can sit on the application object or directly on the service principal (common for SAML apps and some multi-tenant scenarios). Inventory both.

Admin roles and privileged access

The question that matters is who can add a credential to an app that holds powerful permissions. If a helpdesk-level role can add a secret to an app with Mail.Read application permission across the tenant, that role effectively has that permission.

WhoCan manage credentials onControl
Application ownerApps they ownKeep owners minimal and review them every few months, as Microsoft advises; avoid owners on high-privilege apps
Application Administrator, Cloud Application AdministratorAll app registrations and enterprise appsTreat as Tier 0 for tenants with privileged apps; assign through PIM with approval
Global AdministratorEverythingBreak-glass and a very small named group only
Custom role limited to credential rotationScoped appsMicrosoft suggests a least-privileged custom role that can only rotate application credentials for automation

Configuring application management policies requires Security Administrator plus Cloud Application Administrator or Application Administrator, or Global Administrator. Caller exclusions use custom security attributes, so they also involve the Attribute Definition Administrator and Attribute Assignment Administrator roles. See the Azure RBAC and Service Principals Guide for the Azure resource side of the same identities.

Integrations, API tokens and service accounts

Choosing the credential

Where the workload runsUseNotes
Azure (App Service, Functions, VMs, AKS)Managed identityNo credential to rotate or leak. See the Azure Managed Identities Security Guide
GitHub Actions, other clouds, KubernetesFederated identity credentialConfigure only trusted issuers and exact subjects. See the Workload Identity Federation Guide
On-premises service or serverCertificate from a trusted CA, private key non-exportableStore in Azure Key Vault or a hardware-backed store; enforce trusted issuers by policy
Third-party SaaS integration in your tenantVendor's multi-tenant app with consent, not a secret you create and hand overThe vendor holds its own credential; you control consent and permissions
Legacy app that only supports secretsClient secret, short lifetime, in Key VaultDocumented exception with an owner and a migration date

Vendor-held credentials

Backup, security and migration tools often hold an Entra app credential with broad application permissions across customer tenants. Ask each vendor which credential type it uses, how it rotates it, and whether you can restrict sign-ins to its IP ranges. With Workload Identities Premium, Conditional Access for workload identities can block a service principal from outside known IP ranges or when Entra ID Protection flags it as risky.

Rotation that does not cause outages

  1. Add the new certificate or secret alongside the old one (an app can hold several).
  2. Update the consumer from Key Vault and confirm successful sign-ins with the new credential in the service principal sign-in log.
  3. Remove the old credential with removePassword or removeKey, never just let it expire.
  4. Keep the old credential's key ID in the change record so you can tell from logs if anything still tries it.

Logging and detection

SourceWhat to watchWhy
Entra audit log, "Update application" with Certificates and secrets management changes, and service principal updatesNew secrets or certificates on existing apps, especially privileged or long-dormant onesT1098.001 Additional Cloud Credentials persistence
Service principal sign-in logSign-ins from new IP addresses, countries or hosting providers; failures with old key IDsUse of a stolen secret, which blends in as legitimate traffic
Usage and insights: Application credential activityCredentials that are active, expiring or unusedInventory and hygiene
Entra recommendations: Remove unused credentials from applications (staleAppCreds)Credentials unused for 30 daysDead credentials that still work are pure risk
Microsoft Graph activity logs and workload logsUnusual Graph calls by an app, such as bulk mailbox or file readsImpact of a compromised app identity (T1550.001)
Secret scanning with push protection in repositoriesQ~ pattern hitsLeak before use

Credentials added by an attacker to an old, forgotten app are particularly hard to spot. Include legacy and test apps in every credential review.

Responding to a leaked or misused secret

  1. Identify the app: match the secret's key ID or hint (the first characters shown in the portal) to the application and the tenant it works in, and list its application permissions.
  2. Remove the credential: delete the leaked secret immediately. Removing it stops new token requests, but access tokens already issued remain valid until they expire, typically within about an hour.
  3. Look for persistence: check the audit log for other credentials, owners, federated credentials or permissions added to this or other apps since the leak, and remove anything unexplained.
  4. Scope the access: review service principal sign-ins and Microsoft Graph activity for the app over the exposure window, and treat any data the permissions reach as potentially accessed.
  5. Re-issue safely: replace the secret with a certificate or federated credential where possible, rather than another secret.
  6. Fix the source: clean the repository history, pipeline variable or configuration store, and confirm push protection now catches the pattern. See the Git Secret Scanning Guide.

Metrics

  • Secret share: percentage of app registrations and service principals with at least one password credential.
  • Long-lived secrets: secrets with a lifetime above your policy maximum (target zero after migration).
  • Stale credentials: open staleAppCreds items.
  • Unexpected additions: credentials added outside the change process per month, each investigated.
  • Privileged apps on secrets: apps holding high-impact application permissions that still use secrets.
  • Owner hygiene: apps with no owner, or with owners who have left.

Hardening baseline

Application management policies are the enforcement mechanism. Each restriction can apply to all applications, to all with exclusions (named apps or named callers), or to selected applications.

Restriction (portal name)Graph restrictionSuggested setting
Block password additionpasswordAddition, symmetricKeyAdditionOn for all applications, with dated exclusions for legacy apps
Restrict max password lifetimepasswordLifetime, symmetricKeyLifetimeFor excluded apps, a short maximum such as 90 to 180 days
Block custom passwordscustomPasswordAdditionOn: secrets must be generated by Entra
Restrict max certificate lifetimeasymmetricKeyLifetimeAlign with your PKI policy, for example one year
Trusted certificate authority (Graph only)trustedCertificateAuthorityAllow only your enterprise or chosen public CAs
Audiences and identifier URIsaudiences, nonDefaultUriAdditionRestrict multi-tenant and consumer apps unless needed

Application authentication method policies need Premium licensing. Note that the admin center creates custom policies to implement exclusions, and those are visible only through Microsoft Graph, so audit them there.

Rollout

  1. Inventory: export every application and service principal with its passwordCredentials and keyCredentials, end dates, owners and application permissions.
  2. Clean up: remove expired and unused credentials first; it is risk-free and shrinks the problem.
  3. Prioritise: migrate apps with high-impact permissions (mail, files, directory write, RoleManagement) to managed identities, federation or certificates.
  4. Pilot the policy: apply "Block password addition" to selected applications, then all applications with exclusions, watching for broken deployment pipelines that create secrets.
  5. Restrict roles: move Application Administrator and Cloud Application Administrator to PIM, and remove owners from privileged apps.
  6. Monitor: deploy the audit and sign-in alerts above before the policy goes tenant-wide.

Rollback: policy changes apply to new credentials, not existing ones, so a broken pipeline is fixed by adding its caller or app as an exclusion, not by switching the policy off.

Decision guidance

  • Small tenant: remove unused secrets, put the rest in Key Vault with 180-day lifetimes, block new secrets and review monthly.
  • Large tenant: enforce trusted CAs and certificate lifetimes, automate rotation through a credential-only custom role, add Conditional Access for workload identities for privileged apps, and include app credentials in access reviews.
  • Certificate or federation: federate whenever the workload has an issuer Entra can trust; a certificate still has a private key to protect and renew.

Common misconfigurations

  • Two-year secrets on privileged apps. Long lifetimes mean a leaked secret stays valid long after anyone remembers where it went.
  • Several live secrets per app. Lost values get replaced, not removed, and old copies keep working.
  • Secrets on public client apps. Microsoft advises that mobile and desktop apps have no credentials on the application object.
  • Broad app admin roles assigned permanently. A compromised Application Administrator can add a secret to any app and inherit its permissions.
  • Forgotten test and legacy apps with powerful permissions and no owner.
  • No sign-in restrictions on vendor apps holding tenant-wide permissions; restrict them to known IP ranges where licensing allows.

Framework mapping

ControlNIST CSF 2.0NIST SP 800-53 Rev. 5ATT&CK
App credential inventory and lifecyclePR.AA-01AC-2, IA-5T1552.001 Credentials In Files
Certificates and federation over secretsPR.AA-02IA-5(2), IA-9T1078.004 Cloud Accounts
Least privilege for apps and app adminsPR.AA-05AC-6T1098.001 Additional Cloud Credentials
Audit and sign-in monitoringDE.CM-03AU-6, AU-12T1550.001 Application Access Token

Practitioner checklist

  • Export all app registrations and service principals with credentials, end dates, owners and permissions.
  • Remove expired, unused and duplicate credentials.
  • Migrate workloads to managed identities or federated credentials; use certificates where neither fits.
  • Enable "Block password addition" and "Block custom passwords", with dated exclusions.
  • Cap secret and certificate lifetimes and enforce trusted certificate authorities through Graph.
  • Put Application Administrator and Cloud Application Administrator behind PIM and minimise app owners.
  • Alert on credentials added to existing apps and on service principal sign-ins from new locations.
  • Restrict privileged and vendor service principals with Conditional Access for workload identities where licensed.
  • Store remaining secrets in Key Vault and rotate by add, switch, verify, remove.
  • Scan repositories and pipelines for the Q~ secret pattern with push protection on.

Standards and references

Related NHI Mgmt Group resources: Entra ID Applications and Consent Guide · Entra ID Security Guide · Azure Key Vault Security Guide · SaaS and OAuth App Governance Guide · Secrets Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.