Lesson 1 of 3 Application and Workload Identities

Understanding Application Objects and Service Principals

This lesson explains the two objects behind every application in Microsoft Entra ID, and how to harden them.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish application objects from service principals.
  • Compare application credential types.
  • Identify settings that harden an enterprise application.
  • Explain the risk of multitenant applications.

Two objects for one application

When a developer registers an application, Microsoft Entra ID creates an application object in that tenant, which is called the home tenant. This object is a global definition: it holds the application's name, its redirect URIs, its credentials and the permissions that it declares it needs. There is exactly one application object for each application.

A service principal is the local representation of that application in a tenant. It is what actually signs in, and what receives role assignments and consent grants. A service principal is created in the home tenant, and one is also created in every other tenant that adds the application. The relationship is one to many, much as a class relates to its instances.

The admin center separates these two views. App registrations shows application objects, and Enterprise applications shows service principals. A SaaS application that your organization uses appears in Enterprise applications even though its registration lives in the vendor's tenant. This matters for security work: a scenario that asks you to limit who can use an application, or to review what it was granted, belongs in Enterprise applications, whereas one that asks you to add a redirect URI or a credential belongs in App registrations.

Deleting an application object also deletes its service principal in the home tenant, and restoring the application object does not restore the service principal. Deactivation is a safer alternative when you want to stop an application without losing it.

The following diagram shows one application object and its service principals.

One application, several objects. Registering an application creates one application object in the home tenant: the global definition with its name, redirect URIs, credentials and declared permissions, shown in App registrations. A service principal is the application's local instance in a tenant: it signs in and receives role assignments and consent grants, and it is shown in Enterprise applications. One is created in the home tenant and in every other tenant that adds the application.
The relationship is like a class and its instances.
Sort into groups

Application object or service principal?

Exam skills 1.1.4

Decide which object each statement describes.

Log in to try this activity Interactive activities are free with an account.

Application credentials

An application proves its identity with a credential. The following table compares the options, from weakest to strongest.

CredentialHow it worksMain risk
Client secretA shared password generated by the directoryIt can leak in code, logs or configuration, and it must be rotated by hand.
CertificateThe application signs a request with a private keyThe private key must be protected, ideally in Key Vault.
Federated identity credentialThe application presents a token from a trusted external issuer, such as GitHub ActionsThe trust must be scoped tightly, by issuer, subject and audience.
Managed identityThe Azure platform handles the credential completelyIt is available only to workloads on supported Azure resources.

Workload identity federation removes the stored secret. An external system issues a short-lived token, and Microsoft Entra ID exchanges it for an access token if the issuer, subject and audience match a configured trust. For a deployment pipeline in GitHub Actions or Azure DevOps, this is the preferred design.

Scenario questions

Choosing a credential

Exam skills 1.1.4

Choose the credential type for each workload.

Log in to try this activity Interactive activities are free with an account.

Hardening enterprise applications

By default, any user in the tenant can sign in to many enterprise applications. Setting Assignment required to Yes limits sign-in to assigned users and groups, which also reduces the group of people from whom an attacker could obtain useful access. Setting Enabled for users to sign in to No stops all sign-ins, which is the quick response to a suspected malicious application.

Other sound practices include the following.

  • Give each application at least two owners, so that responsibility survives staff changes, and treat ownership as privileged, because an owner can add credentials.
  • Review applications with high-privilege Microsoft Graph permissions, such as the ability to read all mail or modify directory data.
  • Remove unused credentials and applications, and monitor for new credentials, a common persistence technique after compromise.
  • Use the Application Administrator and Cloud Application Administrator roles for management, rather than Global Administrator.
  • Restrict who can register applications through the user settings, if a tenant does not need self-service registration.
Select all that apply

Hardening enterprise apps

Exam skills 1.1.4

Identify the sound practices for enterprise applications.

Log in to try this activity Interactive activities are free with an account.

Single-tenant and multitenant applications

When registering an application, a developer chooses who may sign in. A single-tenant application accepts accounts only from its home tenant. A multitenant application accepts accounts from any Microsoft Entra tenant, and each tenant that consents receives a service principal. From a defensive view, a multitenant application created by a compromised tenant is a recognized attack path, because consent in a victim tenant grants the attacker's application access there. This is why the next lesson treats consent as a security control in its own right.

Worked example

Removing a stored secret from a pipeline

A GitHub Actions workflow deploys to Azure with a service principal client secret stored as a repository secret. The security team requires that no long-lived credential is stored outside Azure. The runner is hosted by GitHub. What should you do?

The decisive fact is that a GitHub-hosted runner is not an Azure resource, so it cannot hold a managed identity directly. The solution is a federated identity credential on the application, or on a user-assigned managed identity, that trusts the repository and branch, with the workflow requesting a token. The secret can then be deleted.

A certificate would still be a long-lived credential stored outside Azure. Rotating the secret more often would reduce the risk, but it would not meet the requirement. A system-assigned managed identity belongs to one Azure resource and cannot be used by the runner.

Check yourself

Where would you go to stop all sign-ins to a suspicious third-party application?

Show answer

Enterprise applications, where you set Enabled for users to sign in to No. The application object lives in the vendor's tenant.

Exam Tips

Remember for the exam

  • App registrations hold the definition; Enterprise applications hold the instance.
  • Assignment required limits who can use an application.
  • Owners can add credentials, so treat ownership as privileged.
  • Use federated credentials for pipelines outside Azure.