<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to create a databricks job with parameters via CLI? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-databricks-job-with-parameters-via-cli/m-p/20529#M13864</link>
    <description>&lt;P&gt;I'm creating a new job in databricks using the databricks-cli:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;databricks jobs create --json-file ./deploy/databricks/config/job.config.json&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With the following json:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
    "name": "Job Name",
    "new_cluster": {
        "spark_version": "4.1.x-scala2.11",
        "node_type_id": "Standard_D3_v2",
        "num_workers": 3,
        "spark_env_vars": {
            "PYSPARK_PYTHON": "/databricks/python3/bin/python3"
        }
    },
    "libraries": [
        {
            "maven": {
                "coordinates": "com.microsoft.sqlserver:mssql-jdbc:6.5.3.jre8-preview"
            }
        }
    ],
    "timeout_seconds": 3600,
    "max_retries": 3,
    "schedule": {
        "quartz_cron_expression": "0 0 22 ? * *",
        "timezone_id": "Israel"
    },
    "notebook_task": {
        "notebook_path": "/notebooks/python_notebook"
    }
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I want to add parameters that will be accessible in the notebook via:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.widgets.text("argument1", "&amp;lt;default value&amp;gt;")
dbutils.widgets.get("argument1")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 15:52:27 GMT</pubDate>
    <dc:creator>User16790091296</dc:creator>
    <dc:date>2021-06-24T15:52:27Z</dc:date>
    <item>
      <title>How to create a databricks job with parameters via CLI?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-databricks-job-with-parameters-via-cli/m-p/20529#M13864</link>
      <description>&lt;P&gt;I'm creating a new job in databricks using the databricks-cli:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;databricks jobs create --json-file ./deploy/databricks/config/job.config.json&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With the following json:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
    "name": "Job Name",
    "new_cluster": {
        "spark_version": "4.1.x-scala2.11",
        "node_type_id": "Standard_D3_v2",
        "num_workers": 3,
        "spark_env_vars": {
            "PYSPARK_PYTHON": "/databricks/python3/bin/python3"
        }
    },
    "libraries": [
        {
            "maven": {
                "coordinates": "com.microsoft.sqlserver:mssql-jdbc:6.5.3.jre8-preview"
            }
        }
    ],
    "timeout_seconds": 3600,
    "max_retries": 3,
    "schedule": {
        "quartz_cron_expression": "0 0 22 ? * *",
        "timezone_id": "Israel"
    },
    "notebook_task": {
        "notebook_path": "/notebooks/python_notebook"
    }
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I want to add parameters that will be accessible in the notebook via:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.widgets.text("argument1", "&amp;lt;default value&amp;gt;")
dbutils.widgets.get("argument1")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:52:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-databricks-job-with-parameters-via-cli/m-p/20529#M13864</guid>
      <dc:creator>User16790091296</dc:creator>
      <dc:date>2021-06-24T15:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a databricks job with parameters via CLI?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-databricks-job-with-parameters-via-cli/m-p/49039#M28456</link>
      <description>&lt;P&gt;This is an old post but still relevant for future readers, so will answer how it is done. You need to add base_parameters flag in the notebook_task config, like the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;"notebook_task": {
  "notebook_path": "...",
  "base_parameters": {
    "argument1": "value"
  }
}           &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 16:37:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-databricks-job-with-parameters-via-cli/m-p/49039#M28456</guid>
      <dc:creator>matthew_m</dc:creator>
      <dc:date>2023-10-12T16:37:51Z</dc:date>
    </item>
  </channel>
</rss>

