<?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: access databricks secretes in int script in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17382#M11409</link>
    <description>&lt;P&gt;Thank you for reply.&lt;/P&gt;&lt;P&gt;The reason we are installing databricks cli on init script is we have requirement to call python notebook via init script.&lt;/P&gt;&lt;P&gt;Btw I managed to access the secrete from secrete scope​ and may be I had some typo.&lt;/P&gt;&lt;P&gt;​example:&lt;/P&gt;&lt;P&gt;Set below in environment variable of cluster between bracket&lt;/P&gt;&lt;P&gt;DToken=​secretes/scope/secretesKey&lt;/P&gt;&lt;P&gt;And remove the DToken from spark environments variable so that it won't be available after the init script.&lt;/P&gt;&lt;P&gt;Example: sed -i '/^D​Token/d' /databricks/spark/conf/&lt;A href="https://spark-environments.sh" alt="https://spark-environments.sh" target="_blank"&gt;spark-env.sh&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Dec 2022 07:13:33 GMT</pubDate>
    <dc:creator>Ravikumashi</dc:creator>
    <dc:date>2022-12-11T07:13:33Z</dc:date>
    <item>
      <title>access databricks secretes in int script</title>
      <link>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17380#M11407</link>
      <description>&lt;P&gt;we are trying install databricks cli on init scripts and in order to do this we need to autheticate with databricks token but it is not secure as anyone got access to cluster can get hold of this databricks token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we try to inject the secretes into secrete scope and access in init script and it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions to access secrete or inject token securely into init scripts ?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 19:01:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17380#M11407</guid>
      <dc:creator>Ravikumashi</dc:creator>
      <dc:date>2022-12-10T19:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: access databricks secretes in int script</title>
      <link>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17381#M11408</link>
      <description>&lt;P&gt;I think you don't need to install CLI. There is a whole API available via notebook. below is example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import requests
ctx = dbutils.notebook.entry_point.getDbutils().notebook().getContext()
host_name = ctx.tags().get("browserHostName").get()
host_token = ctx.apiToken().get()
&amp;nbsp;
# COMMAND ----------
&amp;nbsp;
notebook_folder = '/Users/hubert.dudek@databrickster.com'
&amp;nbsp;
response = requests.get(
f'https://{host_name}/api/2.0/workspace/list',
headers={'Authorization': f'Bearer {host_token}'},
json={'path': notebook_folder}
).json()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 21:21:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17381#M11408</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-12-10T21:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: access databricks secretes in int script</title>
      <link>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17382#M11409</link>
      <description>&lt;P&gt;Thank you for reply.&lt;/P&gt;&lt;P&gt;The reason we are installing databricks cli on init script is we have requirement to call python notebook via init script.&lt;/P&gt;&lt;P&gt;Btw I managed to access the secrete from secrete scope​ and may be I had some typo.&lt;/P&gt;&lt;P&gt;​example:&lt;/P&gt;&lt;P&gt;Set below in environment variable of cluster between bracket&lt;/P&gt;&lt;P&gt;DToken=​secretes/scope/secretesKey&lt;/P&gt;&lt;P&gt;And remove the DToken from spark environments variable so that it won't be available after the init script.&lt;/P&gt;&lt;P&gt;Example: sed -i '/^D​Token/d' /databricks/spark/conf/&lt;A href="https://spark-environments.sh" alt="https://spark-environments.sh" target="_blank"&gt;spark-env.sh&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Dec 2022 07:13:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/access-databricks-secretes-in-int-script/m-p/17382#M11409</guid>
      <dc:creator>Ravikumashi</dc:creator>
      <dc:date>2022-12-11T07:13:33Z</dc:date>
    </item>
  </channel>
</rss>

