<?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 Re: How exactly to create cluster policy via Databricks CLI ? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-exactly-to-create-cluster-policy-via-databricks-cli/m-p/81039#M36208</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/109070"&gt;@guangyi&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Try to add&amp;nbsp;@ before the name of json file&lt;BR /&gt;&lt;BR /&gt;databricks cluster-policies create --json @policy.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also make sure that you're escaping quotation marks like they do in below documenation:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/azure/workspace/clusterpolicies/create" target="_blank" rel="noopener"&gt;Create a new policy | Cluster Policies API | REST API reference | Azure Databricks&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "name": "Test policy",
  "definition": "{ \"custom_tags.test_tag\": { \"type\": \"fixed\", \"value\": \"test_value\" } }\n"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my case after these changes I was able to create policy:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Slash_0-1722323175186.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/9973i23EB75A42DA3EF5C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Slash_0-1722323175186.png" alt="Slash_0-1722323175186.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jul 2024 07:06:59 GMT</pubDate>
    <dc:creator>szymon_dybczak</dc:creator>
    <dc:date>2024-07-30T07:06:59Z</dc:date>
    <item>
      <title>How exactly to create cluster policy via Databricks CLI ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-exactly-to-create-cluster-policy-via-databricks-cli/m-p/81032#M36205</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I tried these ways they are all not working:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Save the json config into a JSON file locally and run&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;databricks cluster-policies create --json cluster-policy.json&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message: Error: invalid character 'c' looking for beginning of value&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Save the json config into a JSON file locally and run&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;databricks cluster-policies create --json @"cluster-policy.json"&lt;/P&gt;&lt;P&gt;Error message: Error: 'definition' must be supplied.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Try using `definition` and run:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;databricks cluster-policies create --definition {"cluster_type":{"type":"fixed","value":"job"}}&lt;/P&gt;&lt;P&gt;Error message: Error: Definition has invalid JSON&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Give a more detailed `definition` and run&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;databricks cluster-policies create --definition {"spark_conf.spark.databricks.cluster.profile":{"type":"forbidden","hidden":true},"spark_version":{"type":"unlimited","defaultValue":"auto:latest-lts"},"node_type_id":{"type":"unlimited","defaultValue":"Standard_DS3_v2","isOptional":true},"num_workers":{"type":"unlimited","defaultValue":4,"isOptional":true},"azure_attributes.availability":{"type":"unlimited","defaultValue":"SPOT_WITH_FALLBACK_AZURE"},"azure_attributes.spot_bid_max_price":{"type":"fixed","value":100,"hidden":true},"instance_pool_id":{"type":"forbidden","hidden":true},"driver_instance_pool_id":{"type":"forbidden","hidden":true},"cluster_type":{"type":"fixed","value":"job"}}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error message: Error: accepts 1 arg(s), received 20&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 05:45:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-exactly-to-create-cluster-policy-via-databricks-cli/m-p/81032#M36205</guid>
      <dc:creator>guangyi</dc:creator>
      <dc:date>2024-07-30T05:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: How exactly to create cluster policy via Databricks CLI ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-exactly-to-create-cluster-policy-via-databricks-cli/m-p/81039#M36208</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/109070"&gt;@guangyi&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Try to add&amp;nbsp;@ before the name of json file&lt;BR /&gt;&lt;BR /&gt;databricks cluster-policies create --json @policy.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also make sure that you're escaping quotation marks like they do in below documenation:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/azure/workspace/clusterpolicies/create" target="_blank" rel="noopener"&gt;Create a new policy | Cluster Policies API | REST API reference | Azure Databricks&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "name": "Test policy",
  "definition": "{ \"custom_tags.test_tag\": { \"type\": \"fixed\", \"value\": \"test_value\" } }\n"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my case after these changes I was able to create policy:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Slash_0-1722323175186.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/9973i23EB75A42DA3EF5C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Slash_0-1722323175186.png" alt="Slash_0-1722323175186.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 07:06:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-exactly-to-create-cluster-policy-via-databricks-cli/m-p/81039#M36208</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-07-30T07:06:59Z</dc:date>
    </item>
  </channel>
</rss>

