There are two ways of using Microsoft Graph to read and write resources
- Delegated permissions: can have delegated permissons, such as Directory.AsUser, but it must go through an interactive sign-in
- Application permissions: doesn’t need an interactive sign-in, perfect for backend service to use. However, cannot have some delegated permission as it’s not a real user, so it’s unable to be delegated.
So, if we build a service or app to access the Microsoft graph, we have to use the application permission mode to avoid the interactive sign-in, which means the access is not triggered by any user. however, When updating the passwordProfile property, the following permission is required: Directory.AccessAsUser.All, which is only a delegated permission. and that’s why the update of the password profile will fail regardless of what permissions assigned.