Hello @Prasad Somasamudra · Welcome to Q&A platform and thanks for your query.
Could you please confirm that you are using Application Administrator or Global Administrator account and have consented for below permissions:
- Application.ReadWrite.All
- Directory.AccessAsUser.All
When you register the application using Azure Portal, under Azure AD > App Registration, a corresponding service principal gets created automatically. However, if you create the application via Graph API using below call, a corresponding service principal doesn't get created automatically.
Call: POST https://graph.microsoft.com/v1.0/applications
Body: { "displayName": "Display name"}
In this case you need to create service principal manually by using below call referencing AppID of the application created by using above call.
Call: POST https://graph.microsoft.com/v1.0/servicePrincipals
Body: { "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }
I tested with GET https://graph.microsoft.com/v1.0/servicePrincipals in my test tenant and was able to get the service principal of Salesforce Enterprise app.
If you are using Graph Explorer to make this call, make sure you are signed in using member account in the tenant where the app is registered. If you are signed in via guest account, graph explorer will execute the call against home tenant of the guest user.
Feel free to tag me in your reply, if you have any further question.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.