Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Create a job, including setup and configuration

A worked example

Single answer

You are creating a Lakeflow Job with two tasks: a notebook task named prepare and a Python script task named load. Both code files are stored on the release branch of an Azure Repos Git repository.

Requirements:

  • Both tasks must run code from the release branch of the Git repository, and each run must execute against the specific commit that exists when the run starts.
  • The load task is given a parameter whose value is {{job.trigger.time.iso_date}}, and the script must read this value.

How should you configure the job?

Choose one answer
Why

The Git provider source meets the versioning requirement. All tasks in the job share the same Git reference, and Azure Databricks snapshots the code at run time so that each run uses a specific commit. Python script tasks receive their parameters, including dynamic values such as {{job.trigger.time.iso_date}}, as command-line arguments. Notebooks are the task type that reads parameters with dbutils.widgets.get().

  • Not correct: Set the source of both tasks to Workspace, and have the script read the date from its command-line arguments. A Workspace source runs code stored directly in the workspace. Only the Git provider source captures a snapshot so that the job executes against a specific commit.
  • Not correct: Set the source of both tasks to DBFS/ADLS, and have the script read the date from its command-line arguments. The DBFS/ADLS source option applies to Python scripts stored in volumes or cloud storage, not to the notebook task. It also does not pin the run to a Git commit.
  • Correct: Set the source of both tasks to Git provider on the release branch, and have the script read the date from its command-line arguments. A Git provider source gives all tasks the same Git reference and runs against a code snapshot taken at run time. Python scripts receive parameters as command-line arguments.
  • Not correct: Set the source of both tasks to Git provider on the release branch, and have the script read the date with dbutils.widgets.get(). The Git configuration is correct, but dbutils.widgets.get() is how notebooks retrieve parameter values. Python script tasks receive parameters as command-line arguments.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free