agentleFS
MicrosoftKnown publishermicrosoft/fabric-org-app-template/.agents/skills/powerbi-secure-embed/SKILL.md

powerbi-secure-embed

Skill1 starsChanged 6 months agoMITView on GitHub

Reference for the Power BI secure embed URL format used by this template. Read when debugging report iframes, when a report fails to load, or when adapting the embed for a non-default scenario.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All URL building lives in src/lib/fabricUrls.ts (getReportEmbedUrl, getOpenAppUrl, getOpenReportUrl) — change embed parameters there, not …

    line 30
  2. Very specific:

    If the user later needs filters, bookmarks, or eventing — switch to powerbi-client.

    line 53
  3. Very specific:

    When deploying somewhere other than localhost:5173, add the deployed origin to:

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

powerbi-secure-embed

What this template uses

This template uses "Embed for your organization" with autoAuth=true — the simplest of the three Power BI embed flows.

{FABRIC_PORTAL_ORIGIN}/reportEmbed
    ?reportId={itemId}
    &groupId={workspaceId}
    &autoAuth=true
    &ctid={tenantId}
    &actionBarEnabled=true
    &reportCopilotInEmbed=true

The embed origin is read from VITE_FABRIC_PORTAL_URL (set by rayfin up / rayfin env from RAYFIN_PUBLIC_PORTAL_URL). The same Fabric portal host serves the report embed endpoint — no fabric.microsoft.com → powerbi.com host swap is needed.

Fabric portalEmbed origin used
https://app.fabric.microsoft.com/https://app.fabric.microsoft.com

The user's existing Power BI / Fabric session signs them into the iframe automatically. No embed token, no service principal, no Power BI Embedded capacity required.

All URL building lives in src/lib/fabricUrls.ts (getReportEmbedUrl, getOpenAppUrl, getOpenReportUrl) — change embed parameters there, not at call sites.

Reference: Embed Power BI content with service principal and secrets / "Embed for your organization"

Parameter source-of-truth

ParamSourceNote
reportIdmanifest.reports[].itemIdThe Power BI report GUID
groupIdmanifest.workspaceIdThe workspace that owns the report
autoAuth=truehard-codedSkips the interactive sign-in inside the iframe
ctidmanifest.tenantIdRequired for multi-tenant guest users; harmless to include always
actionBarEnabled=truehard-codedShows the Power BI action bar (Comment, Subscribe, Share) — parity with in-portal
reportCopilotInEmbed=truehard-codedEnables Copilot pane inside the embed (where tenant policy allows)

What is not this template

This template intentionally does not use:

  • Embed for your customers (app-owns-data) — requires service principal + embed token + Power BI Embedded capacity
  • Embed token flow — requires backend API call to /v1.0/myorg/groups/{groupId}/reports/{reportId}/GenerateToken
  • Power BI Client SDK (powerbi-client) — heavier, gives you JS event hooks but adds bundle weight; the iframe is sufficient for read-only embed

If the user later needs filters, bookmarks, or eventing — switch to powerbi-client. For migration parity with the original Org App, the iframe is correct.

Debugging a non-loading report

SymptomCauseFix
Iframe shows "You don't have access"User is not a viewer of the workspace or the underlying reportVerify in the Fabric portal directly (VITE_FABRIC_PORTAL_URL)
Iframe shows AAD login formautoAuth did not pick up the sessionUser must visit the Fabric portal once in this browser session (e.g. https://app.fabric.microsoft.com/) to seed the cookie
Iframe loads then shows "Tenant mismatch"ctid doesn't match the session tenantConfirm tenantId in the manifest matches az account show --query tenantId
Iframe loads blank, no errorreportId belongs to a different groupIdRe-run the migration agent to refresh the manifest
Mixed content / X-Frame-Options error in consoleSelf-hosted under a non-HTTPS originUse https:// (or http://localhost which Power BI allows)
Iframe loads to a 404 or "site doesn't exist"VITE_FABRIC_PORTAL_URL points at the wrong environmentRe-run rayfin up against the right env, or set RAYFIN_PUBLIC_PORTAL_URL before pnpm dev

Allowed embed origins

When deploying somewhere other than localhost:5173, add the deployed origin to:

  1. rayfin/rayfin.yml → auth.fabric.allowedRedirectUris
  2. The Power BI tenant admin's Embed content in apps allowed-origins list (if your tenant restricts this — most don't)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.