executing-spark

Execute PySpark code on Microsoft Fabric Spark compute via ephemeral Livy sessions.

6|3|Updated Jul 4, 2026
One-click install
npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill executing-spark-insightfulanalytics
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: executing-spark
Source: https://github.com/InsightfulAnalytics/PBI_Agentic_Dev/tree/main/plugins/etl/skills/executing-spark
Command: npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill executing-spark-insightfulanalytics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Running Spark code in Microsoft Fabric normally requires creating and managing notebook artifacts, which adds overhead for quick transformations, ad-hoc queries, or agent-driven automation. This Skill lets you submit arbitrary Python or PySpark code directly to Fabric Spark compute through the Livy API with no persisted notebook. ## Core Features & Use Cases - Ephemeral Livy Sessions: Create, poll, submit statements to, and delete Spark sessions against a Fabric lakehouse, with full read/write access to Delta tables via Spark SQL. - Correct Authentication Flow: Uses an Azure CLI token scoped to the Fabric API, avoiding the common failure of using fab auth tokens that lack OneLake storage access. - Session Lifecycle Safety: Enforces cleanup of sessions in a finally block so idle sessions do not keep consuming Fabric capacity units. - Use Case: An agent needs to aggregate a lakehouse table and write a summary Delta table as part of an ETL pipeline. It creates a PySpark session, submits the transformation, reads the result, and deletes the session, all without creating any notebook artifact. ## Quick Start Ask the agent to run a PySpark query against your Fabric lakehouse using a Livy session and write the results back as a Delta table.

Frequently Asked Questions about executing-spark

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run PySpark code in Microsoft Fabric without a notebook?▼

Use the Fabric Livy API to create an ephemeral Spark session against a lakehouse, submit your code as statements, and poll for results. Authenticate with an Azure CLI token scoped to https://api.fabric.microsoft.com, then delete the session when finished.

When should I use a Livy session versus a Fabric notebook?▼

Use a Livy session for ephemeral transforms, agent-driven compute, and quick read/write tasks where no artifact should persist. Use a notebook for complex multi-cell workflows or scheduled ETL jobs run via fab job run.

Why does the Fabric Livy API reject my token from fab auth?▼

Tokens from fab auth lack the storage scopes needed for OneLake access inside the Spark session, causing errors like REQUEST_INVALID_RESOURCE_NONRETRIABLE. Get a token with az account get-access-token --resource https://api.fabric.microsoft.com instead.

Can I use the deltalake Python library in a Fabric Livy session?▼

No, delta-rs is not pre-installed in Fabric Spark sessions. Use Spark SQL through the built-in spark object for reading and writing Delta tables, which has full metastore and lakehouse access.

What happens if I forget to delete a Livy session in Fabric?▼

Idle sessions keep consuming Fabric capacity units until they time out, which defaults to 20 minutes. Always delete sessions in a finally block, and use the list sessions endpoint to find orphaned sessions.