schema-discovery

作者: microsoft

使用 DAX INFO 函數探索 Power BI 語意模型結構描述。漸進式元資料探索策略、範圍評估,以及縮減技術以用於…

npx skills add https://github.com/microsoft/fabric-apps-analytic-templates --skill schema-discovery

Schema Discovery

Table of Contents

TaskReferenceNotes
Must/Prefer/AvoidSKILL.md: Must/Prefer/AvoidGuardrails for schema discovery
Progressive Discovery StrategySKILL.md: Progressive Schema DiscoveryDecision tree for on-demand metadata fetching
Recommended Discovery OrderSKILL.md: Recommended Discovery OrderStart with scope estimation → tables → columns → measures → relationships
Metadata Object → INFO Function MapSKILL.md: Metadata Object → INFO Function MapTables, columns, measures, relationships, calc groups, calendars, UDFs, variations
Scope Estimation Queriesdiscovery-queries.md: Scope Estimation QueriesProbe table/column/measure/relationship counts before deep discovery
INFO Output Columnsdiscovery-queries.md: INFO Output ColumnsINFO.VIEW.* (read access); INFO.* (may need elevated access)
Narrowing Results (Projection + Filtering)discovery-queries.md: Narrowing ResultsSELECTCOLUMNS + FILTER to reduce output volume
Advanced Metadata (Calc Groups, Calendars, UDFs)discovery-queries.md: Advanced Metadata QueriesINFO.CALCULATIONGROUPS, INFO.CALENDARS, INFO.USERDEFINEDFUNCTIONS, INFO.VARIATIONS
Complete INFO Function Catalogdiscovery-queries.md: Complete INFO Function CatalogDynamic query to enumerate all INFO functions in the engine

Must / Prefer / Avoid

Must

  • Use fully-qualified 'Table'[Column] for column references
  • Use simple [Measure] for measure references

Prefer

  • INFO.VIEW functions for initial metadata discovery (read access, lightweight)
  • Progressive schema discovery over full schema dumps
  • SELECTCOLUMNS + FILTER to narrow INFO results

Avoid

  • Fetching full schema upfront — discover incrementally based on need
  • Re-fetching metadata already discovered in this conversation
  • Using GetSemanticModelSchema or GenerateQuery MCP tools (these are not available)
  • Using DiscoverArtifacts to find a semantic model — that MCP tool is not available; use npx fabric-app-data search (see fabric-cli) instead

Progressive Schema Discovery

Discover metadata incrementally based on what the user actually needs.

Strategy (Decision Tree)

User asks a question
  → Do I know which tables are relevant?
    → NO: Run INFO.VIEW.TABLES() to get table inventory
    → YES: Do I know the columns/measures for those tables?
      → NO: Run filtered INFO.VIEW.COLUMNS() and INFO.VIEW.MEASURES() for those tables
      → YES: Do I need relationships?
        → YES: Run INFO.VIEW.RELATIONSHIPS() filtered to those tables
        → NO: Do I need advanced metadata?
          → Have elevated INFO functions already failed in this session?
            → YES: Skip — assume no permission for all elevated queries
            → NO: Try the relevant elevated query:
              → Calculation groups: INFO.CALCULATIONGROUPS() + INFO.CALCULATIONITEMS()
              → Calendars: INFO.CALENDARS()
              → User-defined functions: INFO.USERDEFINEDFUNCTIONS()
              → Variations: INFO.VARIATIONS()
              → If query fails with permission error: mark elevated access as unavailable
  → Use discovered schema to write DAX queries (see dax-authoring skill)

Rules

  • Start with scope estimation — Run the scope probe query first to understand model size
  • Discover on demand — Only fetch tables/columns/measures relevant to the current user request
  • Use INFO.VIEW functions first (read access) — tables, columns, measures, relationships
  • Use INFO functions (may need elevated access) for: calculation groups, calculation items, variations, user-defined functions, calendars
  • Handle permission failures gracefully — If an elevated INFO function fails but INFO.VIEW.* functions succeeded, assume the user lacks elevated permissions and skip all elevated discoveries entirely
  • Always narrow results — Use SELECTCOLUMNS + FILTER to fetch only needed columns and rows
  • Cache discovered schema mentally — Don't re-fetch what you've already discovered in this conversation

Recommended Discovery Order

  1. Scope estimation — Count tables, columns, measures, relationships
  2. Tables — Get table names, identify relevant ones
  3. Columns — Get columns for relevant tables only
  4. Measures — Get measures (prefer using these over raw aggregations)
  5. Relationships — Get relationships between relevant tables
  6. Advanced metadata (if needed) — Calculation groups, calendars, UDFs, variations

Scope Estimation Query

EVALUATE
ROW(
    "TableCount", COUNTROWS(INFO.VIEW.TABLES()),
    "ColumnCount", COUNTROWS(INFO.VIEW.COLUMNS()),
    "MeasureCount", COUNTROWS(INFO.VIEW.MEASURES()),
    "RelationshipCount", COUNTROWS(INFO.VIEW.RELATIONSHIPS())
)

Metadata Object → INFO Function Map

Metadata ObjectPrimary INFO FunctionsAccess Level
TablesINFO.VIEW.TABLES()Read
ColumnsINFO.VIEW.COLUMNS()Read
MeasuresINFO.VIEW.MEASURES()Read
RelationshipsINFO.VIEW.RELATIONSHIPS()Read
Model configINFO.MODEL()May need elevated
Calculation groupsINFO.CALCULATIONGROUPS(), INFO.CALCULATIONITEMS()May need elevated
CalendarsINFO.CALENDARS(), INFO.CALENDARCOLUMNGROUPS(), INFO.CALENDARCOLUMNREFERENCES()May need elevated
User-defined functionsINFO.USERDEFINEDFUNCTIONS()May need elevated
VariationsINFO.VARIATIONS()May need elevated

For the full query catalog and output column details, see discovery-queries.md.

Running Discovery Queries

Use npx fabric-app-data query <alias> --query '<DAX>' to execute INFO queries against a semantic model. For full CLI options (profiles, file input, result limits), see the fabric-cli skill.

npx fabric-app-data query <alias> --query "EVALUATE INFO.VIEW.TABLES()"

Troubleshooting

ProblemSolution
INFO functions return permission errorsFall back to INFO.VIEW functions; mark elevated access as unavailable for this session
Metadata output too largeUse scope estimation + narrowing patterns from discovery-queries.md

來自 microsoft 的更多技能

oss-growth
microsoft
開源增長駭客角色
agent-framework-azure-ai-py
microsoft
使用Microsoft Agent Framework Python SDK(agent-framework-azure-ai)构建Azure AI Foundry代理。适用于使用AzureAIAgentsProvider创建持久化代理、使用托管工具(代码解释器、文件搜索、网络搜索)、集成MCP服务器、管理对话线程或实现流式响应。涵盖函数工具、结构化输出和多工具代理。
development
airunway-aks-setup
microsoft
在AKS上設定AI Runway——從裸叢集到執行模型。涵蓋叢集驗證、控制器安裝、GPU評估、供應商設定及首次部署。時機:「設定AI Runway」、「上線AKS叢集」、「安裝AI Runway」、「airunway設定」、「部署模型至AKS」、「在AKS上進行GPU推論」、「在AKS上設定KAITO」、「在AKS上執行LLM」、「在AKS上使用vLLM」、「在AKS上設定模型服務」、「AI Runway控制器」。
devops
appinsights-instrumentation
microsoft
使用Azure Application Insights檢測Web應用程式的指南。提供遙測模式、SDK設定與組態參考。適用時機:如何檢測應用程式、App Insights SDK、遙測模式、什麼是App Insights、Application Insights指南、檢測範例、APM最佳實踐。
devops
applicationinsights-web-ts
microsoft
使用Application Insights JavaScript SDK(@microsoft/applicationinsights-web)為瀏覽器/Web應用程式進行檢測。適用於真實使用者監控(RUM)——頁面檢視、點擊、AJAX/fetch依賴、例外、自訂事件,以及與後端OpenTelemetry追蹤關聯的瀏覽器端GenAI代理追蹤。涵蓋SDK載入器指令碼與npm設定、框架擴充(React、React Native、Angular)、點擊分析、遙測初始化器,以及從瀏覽器發出的代理/工具/模型span的OTel GenAI語意慣例。
devops
azure-ai-anomalydetector-java
microsoft
使用適用於 Java 的 Azure AI 異常偵測器 SDK 建置異常偵測應用程式。在實作單變量/多變量異常偵測、時間序列分析或 AI 驅動監控時使用。
development
azure-ai-language-conversations-py
microsoft
使用 azure-ai-language-conversations Python SDK 實作對話語言理解(CLU)。當使用 ConversationAnalysisClient 分析對話意圖與實體、建置 NLP 功能,或將語言理解整合至應用程式時使用。
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python。用於機器學習工作區、作業、模型、資料集、計算資源與管線。 觸發詞:「azure-ai-ml」、「MLClient」、「workspace」、「model registry」、「training jobs」、「datasets」。
development