question

JustinAdan-3078 avatar image
0 Votes"
JustinAdan-3078 asked KranthiPakala-MSFT answered

Getting strange error when trying to connect ADF to dataverse using SPN

Im trying to connect ADF to Dataverse using a SPN. The SPN works properly, and is currently in use for pipelines. However when trying to connect using ADF is get the below error.



Any ideas what I am doing wrong?



Error code23604
DetailsFailed to connect to Dynamics: Unable to Login to Dynamics CRM: Invalid Login Information : The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=https://login.microsoftonline.com/366b8d18-99ea-436a-824b-1ca89c369476/oauth2/authorize, resource_id=REDACTED BUT CORRECT/'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=https://login.microsoftonline.com/366b8d18-99ea-436a-824b-1ca89c369476/oauth2/authorize, resource_id=https://REDACTED BUT CORRECT/'. => The remote server returned an error: (401) Unauthorized.Unable to Login to Dynamics CRM Unable to Login to Dynamics CRM The creator of this fault did not specify a Reason. Activity ID: 833ddfbf-6d40-46da-81af-a2554f3d3b82.

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KranthiPakala-MSFT avatar image
0 Votes"
KranthiPakala-MSFT answered

Hello @JustinAdan-3078,

Thanks for the question and using MS Q&A platform.

From the error message, it seems like your SPN doesn't have permission to your Dynamics CRM. Could you please make sure that the Service Principal permission to Dynamics of was configured correctly?

In order to grant the permissions, you may need a “tenant administrator” to run the below commands to add your application (SP) into the service.
Therefore, please work with your dynamics tenant administrator to grant the app access by running the following command in PowerShell (run as administrator):

  1. Find-Module Microsoft.PowerApps.Administration.PowerShell

  2. Install-Module Microsoft.PowerApps.Administration.PowerShell

  3. Select A (Yes to all)

  4. Import-Module Microsoft.PowerApps.Administration.PowerShell

  5. Add-PowerAppsAccount -Endpoint prod -TenantID <Your APP Tenant ID>

  6. New-PowerAppManagementApp -ApplicationId <Your APP Application ID>

  7. Add-PowerAppsAccount -Endpoint prod -TenantID <Your APP Tenant ID> -ApplicationID <Your APP Application ID> -ClientSecret <Your APP Secret Value> -Verbose

In addition to above, also please refer to the prerequisites mentioned in the ADF connector documentation: Prerequisites

193996-image.png

Hope this helps. Do let us know how it goes.



image.png (73.8 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @JustinAdan-3078,

Just checking in to see if the above answer helped. And, if you have any further query do let us know.

0 Votes 0 ·