So the azp claim is the id of the application that requests the token. When using managed identity, azp will be the id of the managed identity. Meaning we are using managed identity (not the client app reg) to get the access token. That’s what you are seeing when using managed identity.

The client app reg is only used while developing locally, as we cannot use managed identity while developing locally.

To see the Orders.Read roles in the claim, can you please go to the managed identity and check it’s permission to make sure that they have been added? It can be seen in the permissions blade of the managed identity’s service principal.

Microsoft MVP. M365 Developer Architect at Content+Cloud.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store