ADF Web activity can't connect to API When API Key has special character

Nick Baker 1 Reputation point
2021-06-04T11:17:16.133+00:00

I am trying to use a Web activity in an ADF pipeline to issue a GET to an API. The API authentication is through an Authorization header with an API key provided to be by the API developer. The API Key is of the form username:password (note the colon)

102542-image.png

When I try and authenticate against the API with my correct API key containing that colon character, I get the following error (sensitive data redacted):

"Error calling the endpoint 'https://api.XXXXX.com/XXX'. Response status code: ''. More details:Exception message: 'The format of value 'USERNAME:PASSWORD' is invalid.'. No response from the endpoint. Possible causes: network connectivity, DNS failure, server certificate validation or timeout."

When I try with an incorrect API key with no colon, I get a valid response from the API:

"{"payload":{"error_code":401,"message":"Not authorized."},"status":401,"requestTime":"2021-06-04T12:14:33","responseTime":"2021-06-04T12:14:33","statusText":"Unauthorized","url":"XXXX","method":"GET"}"

There is nothing wrong with my original API call - I have tried this exact setup in Postman and it works perfectly. I can only think that the way ADF is sending that header string differs in some way to how Postman sends it when there is a special character.

Any help would be appreciated!

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

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.