"message": "Tenant does not have a SPO license." However I do have a Sharepoint online plan 2 assigned to the Tenant

TommyP 1 Reputation point
2022-09-29T11:26:46.643+00:00

Hi,

I would like to know what license is require to use graph api calls using an application key.

Using this - https://graph.microsoft.com/v1.0/drives/ I get the below.

"error": {  
    "code": "BadRequest",  
    "message": "Tenant does not have a SPO license.",  
    "innerError": {  
        "date": "2022-09-29T11:12:40",  
        "request-id": "ecc4a08f-c623-46f8-86d1-f0d142429c9f",  
        "client-request-id": "ecc4a08f-c623-46f8-86d1-f0d142429c9f"  

I have purchased a Share Point Online 2nd Tier license and can confirm that it is assigned to the tenant.

Regards,

Thomas

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vicky Kumar (Mindtree Consulting PVT LTD) 1,156 Reputation points Microsoft Employee
    2022-09-29T14:20:41.787+00:00

    Personal Microsoft accounts only when creating the application. This may be the cause of the error :'xxxxxxxxxxx'(AppName) is configured for use by Microsoft Account users only. Please use the /consumers endpoint to serve this request.

    According to the documentation. The /tenant id or /contoso.onmicrosoft.com endpoint only allows users with work/school accounts of a specific Azure AD tenant to log in to the application. It does not support personal accounts.

    Only the /common and /consumers endpoints will allow personal Microsoft accounts to log in to the application. Because you can get the correct response only by using your personal account, so you only need to log in using the /common endpoint.