Join our Newsletter — 33% off our NHI Course
Home› Guides› How to enforce app credential lifetimes and block…
Guide Non-Human Identity (NHI)

How to enforce app credential lifetimes and block client secrets with Entra app management policies: staged rollout without breaking apps

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 12 min read
On this page

Finding and rotating expiring client secrets treats the symptom; unless the tenant stops long-lived secrets being created, the same inventory fills up again every quarter. Microsoft Entra app management policies are the preventive control: a tenant default policy and optional per-app policies that cap secret and certificate lifetimes, block new client secrets, and restrict a few other risky app settings. This guide shows how to roll them out safely: what the policy objects are and how they combine, how to use creation dates and exclusions to stage enforcement, how to set them through the admin centre and Microsoft Graph, and how app instance property lock complements them. It is for Entra administrators and identity engineers who own app registration hygiene. The credential hygiene programme as a whole sits in the Azure Entra Client Secrets Security Guide, and finding what already exists is in How to find expiring app secrets and certificates in Entra ID.

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

  • Policies block changes, not sign-ins. Microsoft documents that neither the tenant default nor per-app policies block token issuance for existing applications; only the create or update operation that breaks a rule fails.
  • Two layers, one winner. The tenant default policy (defaultAppManagementPolicy) is disabled until you enable it; a per-app policy (appManagementPolicy) overrides it restriction by restriction, and each app or service principal can have only one.
  • Stage by creation date. Every restriction carries restrictForAppsCreatedAfterDateTime, so you can enforce strict rules on new apps today and move the date back as older apps are migrated.
  • Exclusions are objects too. The admin centre implements exclusions as custom policies visible only in Microsoft Graph, and caller exclusions use custom security attributes; audit them in Graph.
  • Lock what policy does not cover. App instance property lock stops your app's service principals being changed to carry new verification or signing credentials or a different token encryption key; Microsoft states it has been on by default for new apps since June 2026.

How the policy model works

ObjectGraph locationScopeNotes
Tenant default policy/policies/defaultAppManagementPolicyapplicationRestrictions apply to app objects owned by your tenant; servicePrincipalRestrictions apply to service principals of apps from other tenantsAlways exists; isEnabled is false by default; update with PATCH
App management policy/policies/appManagementPoliciesThe applications and service principals listed in its appliesTo relationshipOverrides the default for any restriction it defines; restrictions it leaves out fall back to the default

On a per-app policy a restriction can be enabled (enforced) or disabled (not applied to the linked apps even when the default enforces it). The Graph beta reference also documents an audit state that evaluates without enforcing; treat it as beta behaviour and test it before depending on it. Lifetimes are ISO 8601 durations, such as P90D for 90 days or P365D for one year.

Microsoft's Workload ID FAQ, checked in November 2026, lists application management policies as available in both the free and Premium Workload ID columns. Confirm current licensing for your tenant before planning around it.

Restrictions to use, in rollout order

The full list of restriction names is in the client secrets guide linked above. This table orders the credential restrictions by how disruptive they are to switch on.

OrderRestriction (Graph name, admin centre name)What fails once enforcedTypical starting value
1customPasswordAddition, Block custom passwordsAdding a client-generated secret, as older PowerShell modules do; Entra-generated secrets still workAll apps, early
2passwordLifetime and symmetricKeyLifetime, Restrict max password lifetimeAdding a secret whose end date exceeds the maximumSample: P180D, then shorten
3asymmetricKeyLifetime, Restrict max certificate lifetimeUploading a certificate valid for longer than the maximumAlign with your PKI policy, sample P365D
4trustedCertificateAuthority (Graph only)Adding a certificate from an issuer not on your trusted listAfter certificate issuance is centralised
5passwordAddition and symmetricKeyAddition, Block password additionAdding any new client secretNew apps first, using the creation date, then all apps with exclusions

Values marked "sample" are starting points, not Microsoft defaults. The admin centre pairs the password and symmetric key restrictions, so set both in Graph as well to avoid a gap.

Step-by-step rollout

  1. Baseline the estate. Export every application and service principal with its passwordCredentials and keyCredentials, end dates and created date, as described in How to find expiring app secrets and certificates in Entra ID. Count how many apps would fail each restriction at different lifetimes and creation-date cut-offs.
  2. Find the automation that writes credentials. Pipelines, infrastructure as code and provisioning tools that create apps or add secrets will be the first to break. Search Entra audit logs for application updates in the certificates and secrets management category, and for "Add application", where the actor is a service principal, and list those callers.
  3. Get the right roles. The admin centre needs Security Administrator plus Cloud Application Administrator or Application Administrator, or Global Administrator. Caller exclusions also need Attribute Definition Administrator and Attribute Assignment Administrator. Graph updates to the default policy need Policy.ReadWrite.ApplicationConfiguration.
  4. Enable low-risk rules for new apps. In Entra ID, Enterprise apps, Application policies, or with PATCH /policies/defaultAppManagementPolicy, set isEnabled to true and add customPasswordAddition, passwordLifetime and symmetricKeyLifetime under applicationRestrictions, each with restrictForAppsCreatedAfterDateTime set to today. Existing apps are unaffected.
  5. Block new secrets for new apps. Add passwordAddition and symmetricKeyAddition with the same date. New integrations must use certificates, managed identities or federated credentials; see How to replace Azure app secrets with federated credentials.
  6. Set exclusions deliberately. Use "All applications with exclusions": excluded apps for named legacy apps, excluded callers for automation that creates apps not yet in existence. Give every exclusion an owner and an end date in your register.
  7. Move the date back in steps. As apps are migrated, move restrictForAppsCreatedAfterDateTime earlier, a year at a time, until it predates the oldest app. Each step only affects the next credential change on those apps, so pair each step with the expiry calendar and the owners who will rotate.
  8. Cover foreign service principals. Add servicePrincipalRestrictions for apps from other tenants, which matters most when vendors or partners hold credentials on service principals in your tenant.
  9. Review app instance property lock. For each app, and multi-tenant apps you publish first, open App registrations, the app, Authentication, App instance property lock, and enable it for credentials used for verification, credentials used for signing tokens and Token Encryption KeyId, unless the app genuinely changes them at runtime. In Graph the setting is servicePrincipalLockConfiguration on the application.

Testing: before each step, try the blocked operation with a test app created after the cut-off date and confirm the error, then confirm an excluded app still succeeds. Rollback: because existing tokens keep working, a broken pipeline is fixed by adding its app or caller as an exclusion, or by moving the date forward, not by disabling the whole policy. If someone changes the policy outside the admin centre, the portal disables editing until it is fixed in Graph, so keep Graph access ready.

A sample Graph request for steps 4 and 5

The update call takes only the properties you send; omitted properties keep their current values, and success returns 204 No Content. The body below is a sample for a tenant starting enforcement on 1 December 2026: it blocks custom and new secrets and caps any remaining secret at 180 days and certificates at one year, for apps created after that date. Adjust the dates and durations to your plan.

1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.

Sample 1
PATCH https://graph.microsoft.com/v1.0/policies/defaultAppManagementPolicy
{
  "isEnabled": true,
  "applicationRestrictions": {
    "passwordCredentials": [
      { "restrictionType": "customPasswordAddition", "maxLifetime": null, "restrictForAppsCreatedAfterDateTime": "2026-12-01T00:00:00Z" },
      { "restrictionType": "passwordAddition", "maxLifetime": null, "restrictForAppsCreatedAfterDateTime": "2026-12-01T00:00:00Z" },
      { "restrictionType": "symmetricKeyAddition", "maxLifetime": null, "restrictForAppsCreatedAfterDateTime": "2026-12-01T00:00:00Z" },
      { "restrictionType": "passwordLifetime", "maxLifetime": "P180D", "restrictForAppsCreatedAfterDateTime": "2026-12-01T00:00:00Z" },
      { "restrictionType": "symmetricKeyLifetime", "maxLifetime": "P180D", "restrictForAppsCreatedAfterDateTime": "2026-12-01T00:00:00Z" }
    ],
    "keyCredentials": [
      { "restrictionType": "asymmetricKeyLifetime", "maxLifetime": "P365D", "restrictForAppsCreatedAfterDateTime": "2026-12-01T00:00:00Z" }
    ]
  }
}

Three points are easy to miss. First, treat the passwordCredentials array as a whole: read the current policy with GET and include every restriction you want to keep. Second, the lifetime cap on an app that is also blocked from adding secrets only matters for exclusions and older apps, so it is worth having both. Third, the addition restrictions take a null maxLifetime, because they block creation rather than limit duration. Per-app policies use the same restriction shape under a restrictions property and are linked to apps through appliesTo. Keep the JSON for every policy in source control, so a change made outside the portal can be compared and restored.

Decision guidance

SituationApproachTrade-off
Small tenant, few apps, most already on certificates or managed identitiesEnable the tenant default for all apps with a handful of named exclusionsQuick to finish; each exclusion needs a migration date
Large tenant with many legacy appsCreation-date staging on the default policy, plus per-app policies for groups needing different lifetimesMore objects to govern; keep a register of per-app policies
App that must keep a secret (vendor-supported client secret only)Per-app policy that disables passwordAddition but enforces a short passwordLifetimeThe secret remains, but its useful life is capped
Platform team that provisions apps through automationCaller exclusion for the provisioning identity, with its own controls and monitoringThat identity becomes high value; protect it accordingly
Multi-tenant SaaS publisherApp instance property lock on all published apps, plus trustedCertificateAuthority once certificates come from one issuerRuntime credential changes in customer tenants must be redesigned

Where identity fits

These policies govern the credentials of non-human identities, but the people and automation who can change policies and exclusions hold the real power. Put the Security Administrator, Application Administrator and Cloud Application Administrator roles behind just-in-time activation, and treat any identity that is a caller exclusion as privileged. App owners can add credentials to their apps, so ownership reviews still matter; see How to find and remove stale service principals in Entra ID for retiring apps that no longer need any credential.

Detection and measurement

  • Policy changes: audit events for updates to the default policy, creation of app management policies and changes to their appliesTo list. Alert on any change outside a ticket.
  • Blocked operations: failed credential additions in the Entra audit log show which pipelines and owners are hitting the policy, and where help is needed.
  • Exclusion drift: a weekly Graph export of the custom policies that implement exclusions, compared with the register.
  • Credential additions: new secrets or certificates on existing apps, especially privileged ones, mapped to T1098.001 Additional Cloud Credentials. See the MITRE ATT&CK T1098.001 Account Manipulation page.

Metrics that show the control is working:

  1. Share of app registrations covered by an enforced passwordAddition restriction, with or without exclusion.
  2. Number of active exclusions, each with an owner and an end date (target: falling every quarter).
  3. Client secrets with a lifetime above the policy maximum (target zero for apps inside the creation-date window).
  4. Earliest restrictForAppsCreatedAfterDateTime in force, moving back over time.
  5. Published multi-tenant apps with app instance property lock enabled.

Framework mapping

FrameworkReferenceHow this work supports it
NIST CSF 2.0PR.AA-01Credentials for services are managed by enforced rules, not by habit
NIST CSF 2.0PR.PS-01Tenant configuration baseline for app registrations
NIST SP 800-53 Rev 5IA-5Authenticator lifetime and strength are enforced at creation
NIST SP 800-53 Rev 5CM-6Configuration settings for applications are set and controlled centrally
ISO/IEC 27001:2022 Annex AA.5.17 Authentication informationAllocation and lifetime of app secrets are governed
MITRE ATT&CKT1098.001, T1552.001Fewer, shorter-lived secrets to add, steal or leak

Common failure patterns

  • Switching on "Block password addition" for all apps on day one: the next pipeline run that adds a secret fails. Start with new apps and a creation date.
  • Setting only passwordAddition in Graph: symmetric keys remain a route for shared secrets. Set the pair.
  • Exclusions with no end: the policy looks enforced while the riskiest apps sit outside it.
  • Auditing exclusions in the portal only: the custom policies behind them are visible only in Graph.
  • Expecting the policy to remove old secrets: it blocks new or changed credentials; existing long-lived secrets stay until rotated or removed.
  • Forgetting foreign service principals: applicationRestrictions do not reach vendor apps; add servicePrincipalRestrictions.

Practitioner checklist

  • Export current credentials with created dates and model the impact of each restriction.
  • List automation identities that create apps or add credentials.
  • Enable the tenant default policy with customPasswordAddition and lifetime caps for apps created from today.
  • Add passwordAddition and symmetricKeyAddition for new apps.
  • Run exclusions from a register with owners and end dates, and reconcile it with Graph weekly.
  • Move restrictForAppsCreatedAfterDateTime back in steps as apps migrate.
  • Add servicePrincipalRestrictions for apps from other tenants.
  • Enable app instance property lock on every multi-tenant app you publish.
  • Put policy-changing roles behind just-in-time activation and alert on policy edits.

Standards and references

Related NHI Mgmt Group resources: Azure Entra Client Secrets Security Guide · How to find expiring app secrets and certificates in Entra ID · How to rotate Entra app secrets without downtime · How to replace Azure app secrets with federated credentials

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.

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 both boxes to continue.