Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jannani
Regular Visitor

Oauth2 connection successful (and fetching data) in web activity not working in copy data activity

Hi

 

I am still getting used to Fabric. I am using Web activity to generate refresh token from business central access URL, which is successful.Then I am passing the access token generated to the business central api base url and GET data.

 

This is where things go wrong! I am able to success fully pass this token and get data out put if i use web activity, but if i use copy data activity to do the same, I am getting error. I ve checked so many times but still couldnt figure this out.

 

Same connection details are working in web activity and fetching data but not in copy data activity. What am I missing?

 

Kindly help!!

 

'RestCallFailedWithClientError': Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 400 BadRequest, please check your activity settings.
Response: {"error": {"code": "RequestDataInvalid","message": "Request data is invalid."}},Source=Microsoft.DataTransfer.ClientLibrary,'

 

Jannani_1-1725978542378.png

 

Jannani_0-1725978334071.png

Jannani_0-1725979965513.png

 

Jannani_2-1725978564161.png

 

Output from web connection:

Jannani_3-1725978635381.png

 

Output from copy data activity:

Jannani_4-1725978684176.png

 

Thanks,

Jan

 

 

1 ACCEPTED SOLUTION
v-nuoc-msft
Community Support
Community Support

Hi @Jannani 

 

You can see the error message BadRequest RestCallFailedWithClientError and 400 status code indicates that the copy data activity to send the request data is invalid. Try the following steps:

 

Ensure that the headers and body of the request in the Copy Data activity match exactly with those in the Web activity.

 

Verify that the authentication token is being passed correctly in the Copy Data activity. You can use expressions to dynamically pass the token, such as:

 

"Authorization": "Bearer @{activity('GetAccessToken').output.access_token}"

 

Ensure that the correct URL is used in the copy data activity.

 

The following links may be helpful:

 

Solved: Passing a bearer token to copy data action using G... - Microsoft Fabric Community

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-nuoc-msft
Community Support
Community Support

Hi @Jannani 

 

You can see the error message BadRequest RestCallFailedWithClientError and 400 status code indicates that the copy data activity to send the request data is invalid. Try the following steps:

 

Ensure that the headers and body of the request in the Copy Data activity match exactly with those in the Web activity.

 

Verify that the authentication token is being passed correctly in the Copy Data activity. You can use expressions to dynamically pass the token, such as:

 

"Authorization": "Bearer @{activity('GetAccessToken').output.access_token}"

 

Ensure that the correct URL is used in the copy data activity.

 

The following links may be helpful:

 

Solved: Passing a bearer token to copy data action using G... - Microsoft Fabric Community

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.