FabricTools v0.33.0 Public Preview

Start-FabricSparkJobDefinitionOnDemand

Starts a Fabric Spark Job Definition on demand.

Syntax

Start-FabricSparkJobDefinitionOnDemand [-WorkspaceId] <guid> [-SparkJobDefinitionId] <guid>
 [[-JobType] <string>] [[-waitForCompletion] <bool>] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

This function initiates a Spark Job Definition on demand within a specified workspace. It constructs the appropriate API endpoint URL and makes a POST request to start the job. The function can optionally wait for the job to complete based on the 'waitForCompletion' parameter.

Examples

Example 1

Start-FabricSparkJobDefinitionOnDemand -WorkspaceId "workspace123" -SparkJobDefinitionId "jobdef456" -waitForCompletion $true

Parameters

NameTypeReq.Pos.PipelineDescription
-SparkJobDefinitionId guid ✓Required 1 –

The ID of the Spark Job Definition to be started. This parameter is mandatory.

-WorkspaceId guid ✓Required 0 –

The ID of the workspace where the Spark Job Definition is located. This parameter is mandatory.

-Confirmalias: cf switch Named –

Prompts you for confirmation before running the cmdlet.

-JobType string 2 –

The type of job to be started. The default value is 'sparkjob'. This parameter is optional.

Default: sparkjob
-waitForCompletion bool 3 –

A boolean flag indicating whether to wait for the job to complete. The default value is $false. This parameter is optional.

Default: False
-WhatIfalias: wi switch Named –

Runs the command in a mode that only reports what would happen without performing the actions.

This cmdlet also supports the common parameters, such as -Verbose and -ErrorAction. See about_CommonParameters.

Notes

Ensure that the necessary authentication tokens are valid before running this function. The function logs detailed messages for debugging and informational purposes.

Author: Tiago Balabuch, Kamil Nowinski