Copy data from Sharepoint using Authorization: Bearer token getting status code 401 Unauthorized

Prakash Palanivelu 0 Reputation points
2026-09-03T11:20:09.3133333+00:00

ErrorCode=HttpRequestFailedWithUnauthorizedError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Http request failed with status code 401 Unauthorized, usually this is caused by invalid credentials, please check your activity settings.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Net.WebException,Message=The remote server returned an error: (401) Unauthorized.,Source=System,'

Issue Analysis Status:

When I checked the “DEMO to SharePoint” Power Automate workflow, I noticed that the job was triggered successfully on  last  June 8, 2026.

 

Yesterday, I noticed that my account was linked to one of the Power Automate flows (SharePoint → ADF trigger). I re-authenticated and updated the credentials in Power Automate.

 

The flow is now triggering successfully from Power Automate, but the ADF pipeline is failing when it tries to connect to the Azure application DEMO-data123STG.

Please let me know if you have any suggestions on how we can proceed.

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


3 answers

Sort by: Most helpful
  1. kagiyama yutaka 5,165 Reputation points
    2026-09-03T12:03:51.4566667+00:00

    I think ADF and Power Automate don’t share auth, and ADF only uses the creds saved in its Linked Service when it calls SharePoint. So after re‑auth outside ADF, the DEMO‑data123STG secret and its SharePoint permission need to be refreshed in that Linked Service and “Test connection” run once, because Azure returns 401 only when that stored credential is invalid or doesn’t have enough rights for the site.

    Was this answer helpful?

    0 comments No comments

  2. Niraj Patel 0 Reputation points
    2026-09-03T11:37:45.9333333+00:00

    Kindly assign Application Permission:

    Under Configured permissions, select Add a permission to open the Request API permissions panel.

    Select SharePoint.

    Under What type of permissions does your application require?, select Application permissions.

    Under Select permissions, select Sites.FullControl.All.

    Select Add permissions to create the SharePoint permission.

    Select Grant admin consent

    Was this answer helpful?

    0 comments No comments

  3. Senthil kumar 2,245 Reputation points
    2026-09-03T11:37:15.1066667+00:00

    Hi @Prakash Palanivelu

    First check your Linked services in ADF.

    Open your ADF Linked Service that uses DEMO‑data123STG.

    Verify:

    • Client ID
    • Tenant ID
    • Secret
    • Certificate (if used)
    • Authentication type
    • Token endpoint

    If the secret expired or changed, ADF will always return 401.

    Then check you app registration.

    Go to Azure AD → App Registrations → DEMO‑data123STG.

    Check:

    • Status: Enabled
    • Certificates & Secrets: Valid
    • Secret expiry date

    If the secret expired, ADF cannot authenticate.

    Thanks.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.