'ADF: manage token expiration in copy data activity

I am trying to copy data from a REST API into an Azure SQL Database table. The copy data activity uses pagination and can run longer than 10 minutes after which it's current OAuth2 token expires. Is it possible to change this token during pagination or should I manually handle pagination with a loop in which I get the latest token before firing the next GET request?
It's the same question as on this Microsoft forum that also remained unanswered.



Solution 1:[1]

You can try creating Service Principal as Service Principal authentication type in the REST linked service and Copy activity will refresh the token itself when necessary.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AnnuKumari-MSFT