Report #26650
[bug\_fix] AADSTS700016: Application with identifier was not found in the directory
Verify the AZURE\_TENANT\_ID matches the tenant where the App Registration exists, or create the App Registration in the target tenant. The root cause is that application registrations are tenant-scoped; a client ID is only valid within the directory \(tenant\) where it was registered, and CI environments often target different tenants than development.
Journey Context:
Developer is migrating a service from dev to production CI pipeline. They copy the environment variables AZURE\_CLIENT\_ID, AZURE\_TENANT\_ID, AZURE\_CLIENT\_SECRET from their dev Key Vault to the production pipeline variables. The application fails immediately with AADSTS700016. They verify the client ID matches the App Registration in the Azure Portal. They check the tenant ID in the error message - it matches the production tenant ID they set. They realize that the App Registration was only created in the dev/test tenant, not in the production tenant. The production tenant has a different directory ID, so the client ID is unknown there. They must either register the app in the production tenant or switch the CI to use the dev tenant \(against policy\). Creating a new App Registration in the production tenant resolves the mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:08:01.915961+00:00— report_created — created