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.


4 answers

Sort by: Most helpful
  1. Smaran Thoomu 35,870 Reputation points Microsoft External Staff Moderator
    2026-09-20T06:43:09.7066667+00:00

    Hi @Prakash Palanivelu

    Following up on this issue. Based on the information shared and the 401 Unauthorized error, the Power Automate trigger appears to be working successfully after re-authentication, while the failure occurs when ADF attempts to access SharePoint using the Azure application DEMO-data123STG.

    The most likely causes are:

    • Expired, rotated, or invalid client secret/certificate used by the Azure App Registration.
    • Missing or revoked SharePoint API permissions, or admin consent not applied.
    • Outdated credentials configured in the ADF Linked Service.
    • Recent changes to the App Registration, Key Vault secret, or SharePoint permissions.

    Could you please confirm whether you've reviewed the Linked Service configuration and verified that the App Registration credentials and permissions are still valid? Additionally, if available, sharing the complete ADF activity error details and authentication method configured in the Linked Service would help with further investigation.

    If the issue has been resolved, please let us know the root cause for the benefit of the community.

    Thank you.

    Was this answer helpful?

    0 comments No comments

  2. kagiyama yutaka 5,410 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

  3. 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

  4. Senthil kumar 2,420 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.