fabric-cli

द्वारा microsoft

फैब्रिक-एप-डेटा CLI का उपयोग करके फैब्रिक डेटा स्रोत कनेक्शन प्रबंधित करने का तरीका। प्रोफाइल के साथ fabric.yaml फ़ाइल में वर्कस्पेस/आइटम आईडी बनाए रखें, आईडी द्वारा कनेक्शन जोड़ें…

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

Fabric CLI — Connection Management

Overview

The fabric-app-data CLI manages Fabric data source connections in a fabric.yaml file. It supports multiple profiles (dev, staging, production) and generates TypeScript config that the @microsoft/fabric-app-data consumes at runtime.

Workflow

npx fabric-app-data init                     # 1. Create fabric.yaml
npx fabric-app-data add sales --from-url "https://app.fabric.microsoft.com/..."
                                     # 2. Add connections
npx fabric-app-data generate -o src/fabric.generated.ts
                                     # 3. Generate TypeScript config

Then in your app:

import { FabricClient } from "@microsoft/fabric-app-data";
import { fabricConfig } from "./fabric.generated.js";

const client = new FabricClient({ proxy, ...fabricConfig });

Config discovery

All commands except init walk up the directory tree from the current working directory until they find a fabric.yaml. This means you can run the CLI from any subdirectory of your project (e.g. from src/queries/ or a nested package) and it will pick up the project's root fabric.yaml automatically.

init is the exception — it always writes fabric.yaml to the current working directory, so run it from the project root.

Commands

npx fabric-app-data init

Create a new fabric.yaml in the current directory.

npx fabric-app-data init                    # default "dev" profile
npx fabric-app-data init -p production      # custom profile name
npx fabric-app-data init --force            # overwrite existing

npx fabric-app-data add

Add a connection to a profile. Two modes:

From Fabric portal URL (preferred):

npx fabric-app-data add <alias> --from-url "<Fabric portal URL>"

Explicit IDs:

npx fabric-app-data add semanticModel <alias> -w <workspaceId> -i <itemId>

Important: Use exactly these flag names. The short flags are -w and -i. The long flags are --workspace and --item. Do NOT use --workspace-id or --item-id — those do not exist.

The URL parser extracts workspace ID, item ID, and type automatically. Supported URL segments: semanticmodels, modeling, lakehouses, warehouses. "me" is accepted as workspace ID for My Workspace items.

Options:

  • -p, --profile <name> — target profile (defaults to active)

npx fabric-app-data remove <alias>

Remove a connection by alias.

npx fabric-app-data remove sales
npx fabric-app-data remove sales -p staging

npx fabric-app-data list

List all connections in a profile.

npx fabric-app-data list
npx fabric-app-data list -p production

npx fabric-app-data use <profile>

Switch the active profile and auto-regenerate the config file.

npx fabric-app-data use production
npx fabric-app-data use staging -o src/config/fabric.generated.ts

npx fabric-app-data generate

Generate fabric.generated.ts from the active profile.

npx fabric-app-data generate
npx fabric-app-data generate -o src/fabric.generated.ts
npx fabric-app-data generate -p production

npx fabric-app-data query

Execute a DAX query against a semantic model using the same SDK pipeline as the running app. Aliases: execute, exec.

npx fabric-app-data query <alias> --query '<DAX>'
npx fabric-app-data query <alias> --file src/queries/revenue.dax
npx fabric-app-data query semanticModel <alias> --query '<DAX>'  # explicit source type
npx fabric-app-data query <alias> --query '<DAX>' --limit 50     # return at most 50 rows
npx fabric-app-data query <alias> --query '<DAX>' --profile staging

Options:

  • -q, --query <query> — inline DAX query text
  • -f, --file <path> — path to a .dax file (alternative to --query)
  • -l, --limit <rows> — maximum rows to return (default: 1000, max: 1000)
  • -p, --profile <name> — profile name (defaults to activeProfile)

Result trimming: By default, results are capped at 1000 rows to keep output manageable. When the result is trimmed, the JSON output includes a _cliWarning field indicating how many rows were returned out of the total. This is a CLI-only limitation — the full dataset is available in the running app. If more rows are needed, refine the DAX query with filters or aggregations instead.

fabric.yaml Structure

activeProfile: dev
profiles:
  dev:
    semanticModels:
      sales:
        workspaceId: "00c98f7c-..."
        itemId: "03f2dc11-..."
      myModel:
        workspaceId: "me"
        itemId: "c078a68d-..."
  production:
    semanticModels:
      sales:
        workspaceId: "aabbccdd-..."
        itemId: "11223344-..."

Generated Output

fabric.generated.ts exports a plain config object:

// fabric.generated.ts — AUTO-GENERATED from fabric.yaml (profile: dev). Do not edit.

export const fabricConfig = {
  semanticModels: {
    sales: {
      workspaceId: '00c98f7c-...',
      itemId: '03f2dc11-...',
    },
  },
} as const;

Add fabric.generated.ts to .gitignore — regenerate from fabric.yaml as needed.

microsoft की और Skills

oss-growth
microsoft
OSS ग्रोथ हैकर व्यक्तित्व
official
accessibility-aria-expert
microsoft
React/Fluent UI वेबव्यू में पहुँच संबंधी समस्याओं का पता लगाता है और उन्हें ठीक करता है। स्क्रीन रीडर संगतता के लिए कोड की समीक्षा करते समय, ARIA लेबल ठीक करते समय, सुनिश्चित करते समय उपयोग करें…
official
generate-canvas-app
microsoft
[पुराना हो चुका है — इसके बजाय canvas-app का उपयोग करें] एक पूर्ण Power Apps कैनवास ऐप जनरेट करें।
official
django
microsoft
Django वेब डेवलपमेंट के लिए सर्वोत्तम अभ्यास जिसमें मॉडल, व्यू, टेम्पलेट और परीक्षण शामिल हैं।
official
github-issue-creator
microsoft
कच्चे नोट्स, एरर लॉग्स, वॉइस डिक्टेशन या स्क्रीनशॉट को साफ-सुथरे GitHub-फ्लेवर्ड मार्कडाउन इश्यू रिपोर्ट्स में बदलें। तब उपयोग करें जब उपयोगकर्ता बग जानकारी, एरर…
official
python-package-management
microsoft
निर्भरता प्रबंधन के लिए uv और कार्य स्वचालन के लिए poethepoet का उपयोग करता है।
official
runtime-validation
microsoft
माइग्रेटेड एप्लिकेशन के लिए रनटाइम सत्यापन — परीक्षण रणनीति (योजना चरण) और परीक्षण निष्पादन (सत्यापन चरण) को शामिल करता है: स्टार्टअप सत्यापन,…
official
azure-postgres-ts
microsoft
Azure Database for PostgreSQL Flexible Server से pg (node-postgres) पैकेज का उपयोग करके कनेक्ट करें, जिसमें पासवर्ड और Microsoft Entra ID (पासवर्डलेस) प्रमाणीकरण के लिए समर्थन है।
official