As per your request, the scopes in the token used are openid profile User.ReadBasic.All email
This explains the 403 error because you called GET me/drive/root/search(q='kind:vm')' which as per Search Drive Files requires one of permissions below
Delegated (work or school account) | Sites.Read.All, Sites.ReadWrite.All |
---|---|
Delegated (personal Microsoft account) | Sites.Read.All, Sites.ReadWrite.All |
Application | Sites.Read.All, Sites.ReadWrite.All |
To solve the error, Go to your application on Entra Portal and add the required permissions.
You need to add to delegated permissions.