REST API Connection through ADF Error

S B R Vamsi Manda 36 Reputation points
2022-08-09T20:11:05.403+00:00

Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 401 Unauthorized, please check your activity settings.
Request URL: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelines?api-version=2018-06-01.
Response: {"error":{"code":"AuthenticationFailedInvalidHeader","message":"Authentication failed. The 'Authorization' header is provided in an invalid format."}},Source=Microsoft.DataTransfer.ClientLibrary,'

I have provided respective subid, resourcegroup , datafactoryname and the Additional header as API-KEY and value as 1234

can you please let me know do we require a header to get rest api for pipeline information from rest call

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,376 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,236 Reputation points
    2022-08-10T19:47:13.747+00:00

    Hello @S B R Vamsi Manda and welcome to Microsoft Q&A.

    From the second error message it sounds like you might not have given the proper authorization header.

    It is expecting like

    Header name: "Authorization"
    Heaver value: "Bearer XXXXXXXXXXXXXXXXXXXXXX"

    This bearer token is acquired in a separate step, using https://login.microsoftonline.com/common/oauth2/authorize

    However this is only one of the ways to authorize. Another easier way is to use the System Assigned Managed Identity. For this you need to go to the Azure Portal, and on the resource group of the Data Factory, assign either "Reader" or "Data Factory Contributor" role to the Factory.

    230173-image.png
    230161-image.png


Your answer

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