Skip to main content

Command Palette

Search for a command to run...

TIL: FabricRestClient Supports Long Running Operations

Calling Fabric and Power BI APIs that support LRO using Semantic-Link

Updated
S

Principal Program Manager, Microsoft Fabric CAT helping users and organizations build scalable, insightful, secure solutions. Blogs, opinions are my own and do not represent my employer.

I want to thank Michael Kovalsky for pointing out that FabricRestClient in Semantic Link supports (since v 0.7.5) Long Running Operation (LRO).

💡
LRO support allows the client to wait for the request to process without being blocked. Without LRO support, you will get a 202 response code saying the request is being processed. You need to submit another request based on the url returned to get the result. With LRO support, FabricRestClient will wait 20s and give you the result back.

For any Fabric APIs that support LRO, you just need to pass lro_wait=True

Example:

Below API returns Fabric notebook definition

%pip install semantic-link

import sempy.fabric as fabric

client = fabric.FabricRestClient()

response = client.post(f"v1/workspaces/<ws>/notebooks/<nb>/getDefinition", lro_wait = True)

response

If you would like to learn more about Semantic Link and Semantic Link Labs, watch this excellent session by Michael:

Notes:

  • TIL : Today I Learned

  • Search this for all the Fabric APIs