Unable to copy payload from snowflake sql rest api to Azure blob

John 190 Reputation points
2024-11-10T23:09:03.8133333+00:00

Hi ,

I am using web activity to get oauth token and passing subscription key and token to get method source dataset in a copy activity. postman is giving correct result but getting below error:-

"Code": 22755,

		"Message": "ErrorCode=HttpRequestFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Http request failed with client error, status code 400 BadRequest, please check your activity settings.
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,003 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Chandra Boorla 4,690 Reputation points Microsoft Vendor
    2024-11-11T03:05:43.7733333+00:00

    Hi @John

    Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!

    As I understand that you are facing a "BadRequest" error (HTTP 400) when attempting to copy data from a Snowflake SQL REST API to a Storage account using a Web Activity and Copy Activity in Azure Data Factory (ADF). While Postman requests are successful, ADF pipelines are failing.

    This error typically indicates that the request you are making to the API is malformed or contains incorrect parameters or the service principal or managed identity you are using to access storage account does not have sufficient permissions to access the resource.  

    Even though Postman is giving the correct result, it's crucial to double-check the request body in your ADF pipeline.

    Here are some potential troubleshooting steps that might help you in resolving the issue:

    Authorization Header: Double-check the Authorization header, ensure its formatted correctly as "Bearer <token>". Verify token validity, confirm the token is valid and has the necessary permissions.

    Request Body Issues: Incorrect content type, set the correct content type header, typically "application/json" for JSON payloads. Invalid JSON, validate the JSON structure and formatting. Missing parameters, ensure all required parameters are included in the request body.

    Please refer this similar thread for more insights: https://learn.microsoft.com/en-us/answers/questions/1328130/web-activity-in-azure-data-factory-rest-api-post-m

    Verify the URL and Endpoint: Ensure that the endpoint URL you are using in your web activity is correct and properly formatted. Double-check for any typos or missing components in the URL.

    Necessary Permissions: Ensure that the service principal or managed identity you are using has the necessary permissions to access both snowflake and Azure Storage account.

    For additional information, please refer: Copy and transform data in Azure Data Lake Storage Gen2 using Azure Data Factory or Azure Synapse Analytics.

    Network and Firewall: Check the firewall rule settings of Azure Storage account to ensure that Azure Data Factory IP addresses are in the allowed list.

    For more details, please refer: Configure Azure Storage firewalls and virtual networks.

    URL Configuration: Please ensure that the base URL you have configured for the activity ends with a forward slash (/). If the base URL includes a path, it must end with a forward slash to avoid this error.

    For example, if your base URL is "https://api.example.com/v1", make sure to include the trailing forward slash like this: "https://api.example.com/v1/".

    If you have checked all the above points and are still encountering issues, you can provide more details about your configuration and the exact error message. This will help in giving more specific troubleshooting steps.

    I hope this information helps. Please do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


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.