Skip to main content

Notifications

Announcements

No record found.

Power Platform integration forum
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 45 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,403 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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans