0
votes

The case : CRUD Work Orders in Dynamics 365-Field Service through the Common Data Services OData

  1. I am trying to access to Dynamics 365 Field Service' fields.

I use Python, Flask to build the webapp

  1. I need to CRUD Work orders : https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/msdyn_workorder?view=dynamics-ce-odata-9

  2. I am using the multi-tenant server-to-server authentication mechanism: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/use-multi-tenant-server-server-authentication

  3. I have setup the App Registration on Azure: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app

  4. I have configured several permissions:

  • Odata.FullAccess
  • AX.FullAccess
  • CustomService.FullAccess
  • User.Read
  • User.ReadBasic.All

Azure App Registration : Configured permissions

  1. I use the code-template provided by Microsoft to build my web app interacting with Active Directory and Dynamics 365

    https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-call-api-overview

Error message

Login Failure

invalid_scope
    The provided value for the input parameter 'scope' is not valid. 
    The scope 'Odata.FullAccess User.ReadBasic.All offline_access openid profile' 
    does not exist.

Do you have any idea?

Many thanks for the time you will invest in this issue

1
How are you sending the scope? Is it URL encoded? e.g. scope=user.read%20mail.readPGHE

1 Answers

1
votes

Based on Grant your application rights to access Common Data Service data, you need to select Access Dynamics 365 as organization users.

enter image description here

It is under Dynamics CRM rather than Dynamics ERP.

enter image description here

Odata.FullAccess is a permission under Dynamics ERP, which is not valid for your scene.