New to Kestra?
Use blueprints to kickstart your first workflows.
Submit a Microsoft Fabric Spark Job Definition from Kestra, poll until completion, and chain the result with upstream ingestion and downstream tasks.
id: fabric-run-spark-job
namespace: company.team
variables:
workspace_id: your-workspace-guid
spark_job_definition_id: your-spark-job-definition-guid
tasks:
- id: run_spark_job
type: io.kestra.plugin.microsoft.fabric.data.engineering.RunSparkJob
tenantId: "{{ secret('FABRIC_TENANT_ID') }}"
clientId: "{{ secret('FABRIC_CLIENT_ID') }}"
clientSecret: "{{ secret('FABRIC_CLIENT_SECRET') }}"
workspaceId: "{{ vars.workspace_id }}"
sparkJobDefinitionId: "{{ vars.spark_job_definition_id }}"
wait: true
pollFrequency: PT30S
timeout: PT4H
Run a Microsoft Fabric Spark Job Definition directly from a Kestra flow and block until it reaches a terminal state. This blueprint solves a common gap in the Fabric platform: triggering Spark batch workloads as a managed, observable step inside a larger data pipeline instead of launching them by hand in the Fabric portal or stitching them together with custom scripts. It authenticates with a service principal, submits the job, polls for status, and surfaces the outcome so the rest of your orchestration can react to it.
The flow runs a single run_spark_job task of type io.kestra.plugin.microsoft.fabric.data.engineering.RunSparkJob:
tenantId, clientId, and clientSecret, all read from Kestra secrets.workspaceId and sparkJobDefinitionId, both pulled from flow variables.wait: true, polling status every PT30S (pollFrequency) until the job reaches a terminal state.timeout of PT4H so a stuck or runaway job cannot block the flow indefinitely.Fabric's built-in scheduler can run a Spark job on a clock, but it cannot easily make that job one dependent step in a cross-system pipeline. With Kestra you trigger the job on real events (a file landing, an upstream load finishing, an API webhook), add automatic retries and a timeout, capture lineage and full execution logs, and express the whole pipeline as declarative, version-controlled YAML. The Spark job becomes a coordinated link in a larger flow rather than an isolated scheduled task.
workspace_id and spark_job_definition_id GUIDs from the Fabric portal.FABRIC_TENANT_ID: Entra ID tenant GUID for the service principal.FABRIC_CLIENT_ID: service principal (application) client ID.FABRIC_CLIENT_SECRET: service principal client secret.FABRIC_TENANT_ID, FABRIC_CLIENT_ID, and FABRIC_CLIENT_SECRET as Kestra secrets.workspace_id and spark_job_definition_id variables to your Fabric GUIDs.pollFrequency and timeout to match your workload's expected runtime.trigger so the job fires on a schedule or in response to an upstream event.errors: to alert on failure via Slack or email.retry policy to run_spark_job for transient Fabric or network issues.