Have you configured the correct application permission?
To configure application permissions for your app in the Azure app registrations portal under an application's API permissions page, choose Add a permission, select Microsoft Graph, and then choose the permissions your app requires under Application permissions.
The following screenshot shows the Select Permissions dialog box for Microsoft Graph application permissions.
----------
--please don't forget to upvote
and Accept as answer
if the reply is helpful--