Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Inserting data in Power Apps entity using Common Data Service

Posted on by 3,962

Hi Team, 

 

We are consuming Common Data Service using Azure AD from C# Console Application to insert data in Power Apps Entity

 

1. We are trying to access Power Apps entities from C# Console App through Common Data Service.

2. We have registered the app on Azure AD.

3. We have the ClientID, TenantId, but when we try to insert the data into Power Apps entity using Common Data Service, we get the following error : 

 

AADSTS65001: The user or administrator has not consented to use the application with ID '{client-id}' named '{application created in Azure AD}'. Send an interactive authorization request for this user and resource.

We have user consent in Azure AD app but when we try to access token, we still get the above error. 

 

When I run this link in browser : 

 

https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorize?client_id={client-id}&response_type=code&redirect_uri={redirect_uri}&scope={scope}&prompt={prompt}

 

I replace the tenant-id, client-id, redirect_uri, scope and prompt, but I get "Need admin approval" popup for my work email address. Is there any other solution apart from tenant admin giving approval.

 

I have attached word document to explain what I am doing and what may I be missing.

 

Please help in addressing this issue.

 

Thanks,

Ashish Dhar

  • Suggested answer
    Nishant Rana Profile Picture
    Nishant Rana 55 Microsoft Employee on at
    RE: Inserting data in Power Apps entity using Common Data Service

    This might help

    nishantrana.me/.../

  • RE: Inserting data in Power Apps entity using Common Data Service

    Is your work email address account has the Dynamics 365 administrator or Power Platform administrator role in Microsoft 365 admin center?

     

    Please follow the steps 5-8 from the tutorial below to allow the application to access the API.

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/walkthrough-register-app-azure-active-directory

    After that, create the application user in the Settings area and

    https://docs.microsoft.com/en-us/power-platform/admin/create-users-assign-online-security-roles#create-an-application-user

    assign the security role to the application user

    https://docs.microsoft.com/en-us/power-platform/admin/create-users-assign-online-security-roles#assign-a-security-role-to-a-user

  • RE: Inserting data in Power Apps entity using Common Data Service

    you are trying to login with OAUTH? with Application ID you don't need this. using the CDS SDK you can put the application id and tenant id on the connection string and do the authentication

  • RE: Inserting data in Power Apps entity using Common Data Service
    in your Azure App, have you added the CDS permissions in the API Permission tab of Azure AD?

    After adding permissions then you will need an admin to grant consent on that.
  • Suggested answer
    Linn Zaw Win Profile Picture
    Linn Zaw Win 3,405 on at
    RE: Accessing Common Data Service using Azure AD Authentication

    Is your work email address account has the Dynamics 365 administrator or Power Platform administrator role in Microsoft 365 admin center?

    Please follow the steps 5-8 from the tutorial below to allow the application to access the API.

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/walkthrough-register-app-azure-active-directory

    After that, create the application user in the Settings area and

    https://docs.microsoft.com/en-us/power-platform/admin/create-users-assign-online-security-roles#create-an-application-user

    assign the security role to the application user

    https://docs.microsoft.com/en-us/power-platform/admin/create-users-assign-online-security-roles#assign-a-security-role-to-a-user

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans