Forum Discussion
REST API connection pagination inside Copy Activity Source, AbsoluteUrl points to wrong URL.
- 1 year ago
can't apply your suggestion.
@concat('/iot/api/subscriptions', json(activity('copyFromAPIToLakehouseBronzePagination').output)['next'])The output of activity 'copyFromAPIToLakehouseBronzePagination' can't be referenced since it is either not an ancestor to the current activity or does not exist
When you choose AbsoluteUrl in the pagination rules, the REST connector assumes that the "next" value returned from the API is the full URL to call next. It ignores both:
- The "Base URL" you configured in the linked service
- Any Relative URL you configured in the Copy Activity
Since your "next" only contains the tail path, the connector starts building the request from the domain root, which explains why /iot/api/subscriptions disappears. Given your "next" is /details?... and you always need /iot/api/subscriptions before it, the RelativeUrl + concat() expression approach is the cleanest and does not require redesigning the pipeline.
"paginationRules": {
"absoluteUrl": null,
"relativeUrl": "@concat('/iot/api/subscriptions', json(activity('CopyDataFromAPI').output.response)['next'])"
}
Where:
Replace CopyDataFromAPI with your activity name
Ensure the json() path correctly extracts "next"
If you want, I can give you the exact JSON snippet for the Copy Activity Source that will prepend /iot/api/subscriptions on every "next" call so the connector never drops that segment again.
Please 'Kudos' and 'Accept as Solution' if this answered your query.
- younghoon_kim1 year agoRegular Visitor
can't apply your suggestion.
@concat('/iot/api/subscriptions', json(activity('copyFromAPIToLakehouseBronzePagination').output)['next'])The output of activity 'copyFromAPIToLakehouseBronzePagination' can't be referenced since it is either not an ancestor to the current activity or does not exist