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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
stephanep
New Member

token used to call REST linked service

One of our pipelines runs a dataflow that makes, per batch, calls to a REST linked service.
That Rest linked service uses OAuth 2.0 Client Credential authentication.


It seems that when the dataflow runs for too long, the token expires (and the linked service returns 401).


Does it mean that, in a dataflow run, the token endpoint is called before the first call to the REST linked service, and the same token is used for the other calls in that dataflow ?
Is there any way to configure the calls to the linked service in a way that would force the dataflow to get a new token for each call ?

1 ACCEPTED SOLUTION
nilendraFabric
Super User
Super User

Hello @stephanep 


You are correct in Fabric pipelines, when using a REST-linked service with OAuth 2.0 Client Credentials, the token is generated once at the start of the dataflow execution and reused for subsequent calls. This can lead to 401 errors if the token expires mid-execution.

• Access tokens typically expire in 5–10 minutes, while refresh tokens may last up to 30 days.
• Fabric/ADF does not automatically refresh tokens during a dataflow execution. If the pipeline exceeds the token’s lifespan, subsequent calls fail with a 401 error.

 

Some workarounds 

 

Use a Web Activity to fetch a new access token before each API call or series of requests



GET https://<token-endpoint>
Headers: Authorization: Basic <base64(client_id:client_secret)>
Body: grant_type=client_credentials

 

 

Implement retry logic to detect 401 errors and trigger token refresh

If this is helpful please accept the answer and gives kudos 

 

 

View solution in original post

1 REPLY 1
nilendraFabric
Super User
Super User

Hello @stephanep 


You are correct in Fabric pipelines, when using a REST-linked service with OAuth 2.0 Client Credentials, the token is generated once at the start of the dataflow execution and reused for subsequent calls. This can lead to 401 errors if the token expires mid-execution.

• Access tokens typically expire in 5–10 minutes, while refresh tokens may last up to 30 days.
• Fabric/ADF does not automatically refresh tokens during a dataflow execution. If the pipeline exceeds the token’s lifespan, subsequent calls fail with a 401 error.

 

Some workarounds 

 

Use a Web Activity to fetch a new access token before each API call or series of requests



GET https://<token-endpoint>
Headers: Authorization: Basic <base64(client_id:client_secret)>
Body: grant_type=client_credentials

 

 

Implement retry logic to detect 401 errors and trigger token refresh

If this is helpful please accept the answer and gives kudos 

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors