question

DanielH-3193 avatar image
0 Votes"
DanielH-3193 asked MartinJaffer-MSFT answered

Pagination URL issue with REST Connector as Source in ADFv2 Copy Activity

I've encountered a possible issue/defect when using the Pagination function when connecting to a REST resource in the Copy Activity.

The Absolute Url parameter is expecting a jsonpath expression that points to either the Absolute URL or the Relative URL specified in the current response body that should provide the next set of results.

Absolute URL being the FQDN URI (eg. https://example.com/api/v1/service/ )
and Relative URL being just a path ( eg api/v1/service/ ).

I expect the system will distinguish the two, and if a relative URL is provided, it will be appended to the Base URL configured in the Linked Service.

I have a service which unfortunately adds a leading slash and skips the 'api' part of the path - eg. the value I get from the service is : "/v1/service/...<foo>"

However even with this erranous path, I expect that if I configure the Base URL in the Linked Service to be https://example.com/api , then the the system should append the "Absolute Url" parameter value to the Base URL in the Linked service. However it is not, it seems to not obeying the Base URL path configured in the Linked Service, what it seems to be doing is stripping away all of the the path from the original URI and then appends the Absolute Url value (eg. https://example.com/v1/service/ ) which of course will results in a 4xx error from the server.

It seems as if the system is not looking back at the Base URL on the Linked service, and instead is just looking at whatever URL was used in the original request and stripping away the whole path and re-writing it and I'm not so sure this is how it should behave as I think it should always refer back to the Base URL configuration of the Linked service.

81646-image.png


azure-data-factory
image.png (24.8 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @DanielH-3193 and welcome to Microsoft Q&A.

I have reproduced the issue you have described. I agree with your assessment and expectations. I will reach out to the developers to find out what the intended behavior is, and get back to you when I have a response.

1 Vote 1 ·

Thanks Martin.

0 Votes 0 ·

1 Answer

MartinJaffer-MSFT avatar image
1 Vote"
MartinJaffer-MSFT answered

Hi @DanielH-3193 , I heard back from the product group.
There is additional meaning to beginning the relative URL with / like paths in BASH.

When the relative URL starts with / , then it appends to the root of the base URL.
When the relative URL does not start with / , then it appends to the end of the base URL.

like
"https://reqres.in/api" + "/users" = https://reqres.in/users
"https://reqres.in/api" + "api/users" (without the leading /) = "https://reqres.in/api/api/users"

I am putting in a document update request to have this explicitly stated in the documentation.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.