<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to extract DMV data from multiple warehouses/lakehouses? in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4818113#M3683</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307948" data-lia-user-login="Jeanxyz" class="lia-mention lia-mention-user"&gt;Jeanxyz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thank you for reaching out to Microsoft Community.&lt;/P&gt;
&lt;P&gt;Currently, Microsoft Fabric does not support running a single DMV query that loops over all lakehouses and warehouses across different workspaces. There is no built-in or native "cross-workspace" DMV querying mechanism available. However, it is possible to build an automated, orchestrated solution using tools like Microsoft Fabric APIs, Azure Functions, or Data Factory pipelines to dynamically collect this information.&lt;/P&gt;
&lt;P&gt;The process begins by retrieving a list of all workspaces. To do this, you'll need admin permissions and can use endpoints such as admin/workspaces from the Power BI REST API or Microsoft Graph API. Once you have the workspaces, you can loop through each one and identify the Fabric items within them. Specifically, you should look for items of type "Lakehouse" and "Warehouse" in each workspace. These can be found using Fabric APIs or Graph API beta endpoints.&lt;/P&gt;
&lt;P&gt;After identifying the lakehouses and warehouses, you can run the appropriate DMV queries for each. This can be done using a Fabric Notebook, Data Pipeline, or Azure Function. For example, you might run a query like:&lt;/P&gt;
&lt;P&gt;SELECT * FROM &amp;lt;lakehouse_or_warehouse&amp;gt;.queryinsights.exec_requests_history&lt;BR /&gt;WHERE start_time &amp;gt;= DATEADD(MINUTE, -60, GETUTCDATE())&lt;/P&gt;
&lt;P&gt;The results from each query should then be aggregated and stored in a central location, such as a designated lakehouse or warehouse (e.g., admin_monitoring_lakehouse). This centralized data can then be used for reporting or monitoring via Power BI dashboards or other Fabric tools.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Sep 2025 11:45:09 GMT</pubDate>
    <dc:creator>v-echaithra</dc:creator>
    <dc:date>2025-09-05T11:45:09Z</dc:date>
    <item>
      <title>how to extract DMV data from multiple warehouses/lakehouses?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4817823#M3679</link>
      <description>&lt;P&gt;Just out of curiosity, I'm wondering if it's possible to create a DMV query that loops over all the lakehouses and warehouses across multiple workspaces? In this way, a Fabric admin can monitor queries in one place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my DMV, it extracts queries run in stock_lakehouse during the past hour. I want to avoid inputting the lakehouse name in a hard code, is it possible to get a lot of all the workspaces, then a list of lakehouses and warehouses for each workspace?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT *
FROM stock_lakehouse.queryinsights.exec_requests_history 
WHERE start_time &amp;gt;= DATEADD(MINUTE, -60, GETUTCDATE())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 08:10:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4817823#M3679</guid>
      <dc:creator>Jeanxyz</dc:creator>
      <dc:date>2025-09-05T08:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract DMV data from multiple warehouses/lakehouses?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4818113#M3683</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307948" data-lia-user-login="Jeanxyz" class="lia-mention lia-mention-user"&gt;Jeanxyz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thank you for reaching out to Microsoft Community.&lt;/P&gt;
&lt;P&gt;Currently, Microsoft Fabric does not support running a single DMV query that loops over all lakehouses and warehouses across different workspaces. There is no built-in or native "cross-workspace" DMV querying mechanism available. However, it is possible to build an automated, orchestrated solution using tools like Microsoft Fabric APIs, Azure Functions, or Data Factory pipelines to dynamically collect this information.&lt;/P&gt;
&lt;P&gt;The process begins by retrieving a list of all workspaces. To do this, you'll need admin permissions and can use endpoints such as admin/workspaces from the Power BI REST API or Microsoft Graph API. Once you have the workspaces, you can loop through each one and identify the Fabric items within them. Specifically, you should look for items of type "Lakehouse" and "Warehouse" in each workspace. These can be found using Fabric APIs or Graph API beta endpoints.&lt;/P&gt;
&lt;P&gt;After identifying the lakehouses and warehouses, you can run the appropriate DMV queries for each. This can be done using a Fabric Notebook, Data Pipeline, or Azure Function. For example, you might run a query like:&lt;/P&gt;
&lt;P&gt;SELECT * FROM &amp;lt;lakehouse_or_warehouse&amp;gt;.queryinsights.exec_requests_history&lt;BR /&gt;WHERE start_time &amp;gt;= DATEADD(MINUTE, -60, GETUTCDATE())&lt;/P&gt;
&lt;P&gt;The results from each query should then be aggregated and stored in a central location, such as a designated lakehouse or warehouse (e.g., admin_monitoring_lakehouse). This centralized data can then be used for reporting or monitoring via Power BI dashboards or other Fabric tools.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 11:45:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4818113#M3683</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-09-05T11:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract DMV data from multiple warehouses/lakehouses?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4819774#M3700</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307948" data-lia-user-login="Jeanxyz" class="lia-mention lia-mention-user"&gt;Jeanxyz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Chaithra E.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 09:15:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4819774#M3700</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-09-08T09:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract DMV data from multiple warehouses/lakehouses?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4819806#M3701</link>
      <description>&lt;P&gt;It looks one can get a list of items in fabric workspace via sempy packages. I will try this in notebook when I get some time this weekend. Will post here if I get good news.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/python/api/semantic-link-sempy/sempy.fabric?view=semantic-link-python" target="_blank"&gt;https://learn.microsoft.com/en-us/python/api/semantic-link-sempy/sempy.fabric?view=semantic-link-python&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 09:35:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4819806#M3701</guid>
      <dc:creator>Jeanxyz</dc:creator>
      <dc:date>2025-09-08T09:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract DMV data from multiple warehouses/lakehouses?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4819942#M3702</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307948" data-lia-user-login="Jeanxyz" class="lia-mention lia-mention-user"&gt;Jeanxyz&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will display all items in the respective workspaces.&lt;/P&gt;&lt;P&gt;I use this often in customer projects and it helps enorm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# 1) Install Package Semantic Link
%pip install --upgrade semantic-link-sempy -q

# 2) Imports the Libraries

import sempy.fabric as fabric
import pandas as pd
from IPython.display import display, HTML

def summarize_workspace_items(full_display: bool = True):
    
    # 3) Get Workspaces from the Tenant
    workspaces = fabric.list_workspaces()
    workspaces = workspaces.query("Type == 'Workspace'")  # only normal workspaces, not the own workspace
    
    rows = []
    
    for ws_id, ws_name in zip(workspaces["Id"], workspaces["Name"]):
        items = fabric.list_items(workspace=ws_id)
        if items.empty:
            continue
        
        # Automatically determine all item types
        for item_type in items["Type"].unique():
            subset = items[items["Type"] == item_type].copy()
            if subset.empty:
                continue
            
            subset["workspace_name"] = ws_name
            subset["Item Type"] = item_type
            subset["item_id"] = subset["Id"]
            subset["item_name"] = subset.get("Name", subset.get("displayName", subset.get("Display Name")))
            
            rows.append(subset[["item_id", "item_name", "workspace_name", "Item Type"]])
    
    # 4) Combine all rows
    if rows:
        df = pd.concat(rows, ignore_index=True)
    else:
        df = pd.DataFrame(columns=["item_id", "item_name", "workspace_name", "Item Type"])
    
    # 5) Sort the DataFrame
    df = df.sort_values(["workspace_name", "item_name"]).reset_index(drop=True)
    
    # 6) Display the full table if requested / Its besser to show
    if full_display:
        pd.set_option("display.max_rows", None)
        pd.set_option("display.max_columns", None)
        pd.set_option("display.width", 200)
        display(HTML(df.to_html(max_rows=None, max_cols=None)))
    
    return df

# Execute the function and get the DataFrame
df_items = summarize_workspace_items()&lt;/LI-CODE&gt;&lt;P&gt;i Hope that help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 11:07:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4819942#M3702</guid>
      <dc:creator>spaceman127</dc:creator>
      <dc:date>2025-09-08T11:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract DMV data from multiple warehouses/lakehouses?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4821541#M3710</link>
      <description>&lt;P&gt;Thanks a lot, it works. I also managed to extract queries from&amp;nbsp; warehouses/lakehouses across workspaces thanks to the item extraction function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Sep 2025 14:58:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/how-to-extract-DMV-data-from-multiple-warehouses-lakehouses/m-p/4821541#M3710</guid>
      <dc:creator>Jeanxyz</dc:creator>
      <dc:date>2025-09-09T14:58:42Z</dc:date>
    </item>
  </channel>
</rss>

