...
Navigate to https://admin.microsoft.com and sign in, or from your Dataverse environment web page, and select the application launcher in the top left corner.
Choose Admin > Admin centers > Azure Active Directory
From the left panel, choose Azure Active Directory > App registrations (Preview)
Choose + New registration
In the Register an application form provide a name for your app, select Accounts in this organizational directory only, and choose Register. A redirect URI is not needed for this walkthrough and the provided sample code
...
6. Navigate to https://admin.microsoft.com and sign in, or from your Dataverse environment web page, and select the application launcher in the top left corner.. On the Overview page, select API permissions
...
7. Choose + Add a permission
8. In the Microsoft APIs tab, choose Dynamics CRM
9. In the Request API permission form, select Delegated permissions, check user_impersonation, and select Add permissions