'I am not able to connect to dataverse API through Logic Apps - Error: "The user is not a member of the organization."

I have successfully created a custom Dataverse connector in the maker portal, registered my logic app, setup Oauth with a client ID and Secret and granted the Dataverse user_impression permissions but I keep getting the same error when running the HTTP connector to the API:

enter image description here

 "statusCode": 403,
"headers": {
    "x-ms-service-request-id": "3a71f33b-3a87-4872-8e78-dcce7cf5c2e7,8c66ea1c-72cd-42f3-a3a2-ca8405a27974",
    "Set-Cookie": "ARRAffinity=550d2c7e1d29b87d71abd7befbfce92cae8b7575787ae5948b07c246c1598307; domain=orgbdaef3f8.crm3.dynamics.com; path=/; secure; HttpOnly,ReqClientId=d3014d84-a8ca-4b3e-ab63-9ebe993dddf6; expires=Wed, 16-Mar-2072 14:03:54 GMT; path=/; secure; HttpOnly,ARRAffinity=550d2c7e1d29b87d71abd7befbfce92cae8b7575787ae5948b07c246c1598307; domain=orgbdaef3f8.crm3.dynamics.com; path=/; secure; HttpOnly",
    "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
    "REQ_ID": "8c66ea1c-72cd-42f3-a3a2-ca8405a27974",
    "AuthActivityId": "ea493868-8543-49d4-99d6-9f76c968fedb",
    "X-Source": "12125111998148129792281252112708712621544171224401241651522061293833167237131240235,12125111998148129792281252112708712621544171224401241651522061293833167237131240235",
    "Public": "OPTIONS,GET,HEAD,POST",
    "Date": "Wed, 16 Mar 2022 14:03:53 GMT",
    "Content-Length": "89",
    "Allow": "OPTIONS,GET,HEAD,POST",
    "Content-Type": "application/json"
},
"body": {
    "error": {
        "code": "0x80072560",
        "message": "The user is not a member of the organization."
    }
}

}

I have looked at every post I can find and followed all of the Microsoft guides on this and still can't figure it out. I have no issues connecting to the Graph API using the exact same Oauth security methodology.

Anyone have any suggestions or need more information?

Thanks in advance.



Solution 1:[1]

Figured it out... * facepalm * you have to add an application user in your Dataverse environment admin area - Settings - Application users. You add a new app user and enter the Azure Client App ID, choose Service Writer security role if you need the app to have read/write access and * BAM ! *

It works! Hopefully this post will help someone else struggling with this connection issue!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 EPStudio