Keys / Microsoft Entra ID

AZURE_CLIENT_SECRET

A client secret of a Microsoft Entra app registration. Your app signs in as that app with it, AZURE_CLIENT_ID and AZURE_TENANT_ID.

Expires
you choose, up to 24 months
API
add and remove, with Microsoft Graph

Get it

Create one on entra.microsoft.com. The steps aren't recorded yet.

Set it

AZURE_CLIENT_SECRET=...

EnvironmentCredential and DefaultAzureCredential in the Azure Identity libraries for Python, JavaScript, Go and Java read it, with AZURE_CLIENT_ID and AZURE_TENANT_ID. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Microsoft recommends a managed identity, a certificate or a federated credential over a client secret where you can use one.
  2. In App registrations, open the app, then Certificates & secrets > Client secrets > New client secret. Microsoft recommends an expiry under 12 months. Copy the value; it's shown once. With the Azure CLI, run az ad app credential reset --id <app-id> --append; without --append it overwrites the app's existing credentials.
  3. Deploy the new value everywhere that reads AZURE_CLIENT_SECRET.
  4. Check that nothing still uses the old secret, then delete it.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16