One Line Code To Get A List Of Items From All The Fabric/Premium Workspaces

Sandeep PawarSandeep Pawar
1 min read

What the title says, thanks to the latest version (v0.5) of Semantic Link

!pip install --upgrade semantic-link --q #upgrade to semantic-link v0.5

import sempy.fabric as fabric
import pandas as pd 

df = pd.concat([fabric.list_items(workspace=ws) for ws in fabric.list_workspaces().query('`Is On Dedicated Capacity` == True').Id], ignore_index=True)
df

💡
If you have a large tenant with thousands of workspaces and items, this will be slow. In that case optimize the code to execute in parallel using ThreadPoolExecutor
0
Subscribe to my newsletter

Read articles from Sandeep Pawar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sandeep Pawar
Sandeep Pawar