Recently I have seen lots of “vibe coded” tools hitting social media offering to help people assign Graph API permissions directly to Managed Identities in Microsoft Entra. It made me think to myself, why go through the trouble to assigning permissions to Managed Identities, when you could just federate your Managed Identity with an App Registration and assign permissions to the “easier to manage” App Registration.
Both of these approaches achieve the same ultimate goal, providing an Azure resource secretless, app-only access to the Microsoft Graph API, but they differ fundamentally in which identity holds the permissions and how the identity lifecycle and token exchange are managed.
Let’s break down these approaches.
Managed Identity with Directly Assigned Permissions
In this architecture, you bypass App Registrations entirely. The Azure resource uses its System-Assigned or User-Assigned Managed Identity to authenticate directly to Microsoft Entra ID and request a token for Microsoft Graph.
The API permissions are granted directly to the Enterprise Application (Service Principal) backing the Managed Identity. When the workload requests an access token for the resource behind Microsoft Graph, Entra ID checks the Managed Identity’s direct assignments and issues a token containing those permissions.
This approach is fairly simple, as there is only one identity and with System-Assigned Managed Identities, once the resource is destroyed so it the Managed Identity, which helps from the Lifecycle point of view.
The main challenge with this approach is that Managed Identities are not immediately visible by default under the Enterprise Applications blade in Entra, you must apply a filter. And you cannot directly assign Graph API permissions to a Managed Identity using the Entra admin center, you must use the Graph API itself, which means another App Registration is indirectly required to achieve the requirements. I have guidance on assigning permissions to a Managed Identity with Graph PowerShell.
Workload Identity Federation with an App Registration
The alternative approach is to use the Managed Identity solely as a credential to unlock an App Registration, and the App Registration holds the actual Graph API permissions.
You configure a Federated Identity Credential on the App Registration, instructing it to trust the specific Managed Identity. The token acquisition then becomes a two step process:
- The Azure resource requests a standard token for its Managed Identity.
- Then sends that token to Entra ID to request an Access Token to the requested resource on behalf of the App Registration.
Operationally for the Admin, this approach is a little easier, as you can simply complete all the configuration of permissions via the Entra Admin portal and then the permissions are easily auditable via the UI. It also allows for separation of duties in larger teams, where the resource owner can managed the resources and Managed Identity, and the IAM team can manage the App Registration.
The con is that its architecturally a little more complex as you have to setup and manage two separate identity objects. In code, you must also handle the federated token exchange, however, I have solved this for Microsoft Graph PowerShell using my MiToken PowerShell module.
Which is better
It really depends on your organisation and how you operate your environment. Direct Managed Identity permission assignments are simple and are “attached” to the lifecycle of the resource in most instances. But, WIF can be setup and audited directly from the Entra Admin Center. Personally, I prefer WIF.
Here is a breakdown in table form to help you make your own decision:
| Feature | Direct Assignment to Managed Identity | WIF with App Registration |
|---|---|---|
| Identity Holding Permissions | Managed Identity's Service Principal | App Registration's Service Principal |
| Token Acquisition | Single step (Standard MSI token) | Two steps (MSI token exchanged for App token) |
| Permission Management | PowerShell / CLI / Graph API only | Entra UI or Graph API |
| Reusability | 1:1 (Tied to the specific Managed Identity) | 1:Many (Up to 20 federated identities per App) |
| Best For | Isolated, single-purpose resources where you want strict, automated lifecycle clean up. | Complex environments requiring centralised permission management, GUI visibility, and separation of duties. |

