<?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 to add environment variable in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30164#M21838</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can create an init script which will run a bash script which can set unix environment variables. Go to Databricks Guide &amp;gt;&amp;gt; AWS Configuration &amp;gt;&amp;gt; Init Scripts for more details.&lt;/P&gt;
&lt;P&gt;-Vida&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Sep 2015 16:33:52 GMT</pubDate>
    <dc:creator>vida</dc:creator>
    <dc:date>2015-09-04T16:33:52Z</dc:date>
    <item>
      <title>How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30163#M21837</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Instead of setting the AWS accessKey and secret Key in hadoopConfiguration, I would like to add those in environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.&lt;/P&gt;
&lt;P&gt;How can I do that in databricks? &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2015 04:24:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30163#M21837</guid>
      <dc:creator>samalexg</dc:creator>
      <dc:date>2015-09-04T04:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30164#M21838</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can create an init script which will run a bash script which can set unix environment variables. Go to Databricks Guide &amp;gt;&amp;gt; AWS Configuration &amp;gt;&amp;gt; Init Scripts for more details.&lt;/P&gt;
&lt;P&gt;-Vida&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2015 16:33:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30164#M21838</guid>
      <dc:creator>vida</dc:creator>
      <dc:date>2015-09-04T16:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30165#M21839</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks for your response. I want to add one more environment variable apart from the AWS properties. I just created the init script as mentioned in documentation. I restarted my cluster. And when I read the env variable like &lt;PRE&gt;&lt;CODE&gt;sys.env.get(envName);&lt;/CODE&gt;&lt;/PRE&gt; in scala. But it returns nothing. How to check whether my init script is executed or not?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2015 06:05:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30165#M21839</guid>
      <dc:creator>samalexg</dc:creator>
      <dc:date>2015-09-07T06:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30166#M21840</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;In the init scipts notebook is details on how to find the output:&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;Output from all init scripts are generated here: &lt;B&gt;dbfs:/databricks/init/output/&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 20:48:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30166#M21840</guid>
      <dc:creator>vida</dc:creator>
      <dc:date>2015-09-08T20:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30167#M21841</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes I've verified that. But nothing is there in &lt;B&gt;dbfs:/databricks/init/output/&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 09:19:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30167#M21841</guid>
      <dc:creator>samalexg</dc:creator>
      <dc:date>2015-09-09T09:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30168#M21842</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Did you put an echo command or something in your script so that it will output something?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 16:43:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30168#M21842</guid>
      <dc:creator>vida</dc:creator>
      <dc:date>2015-09-09T16:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30169#M21843</link>
      <description>&lt;P&gt;@samalexg​&amp;nbsp;: are you sure you're writing to the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/etc/environment&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; file as follows:&lt;/P&gt;&lt;P&gt;otherwise, the env vars are only set for the process that is called to run the script.&lt;/P&gt;&lt;P&gt;i assume you're doing this, but wanted to double check as this has been a common mistake in the past.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.put(s"""dbfs:/databricks/init/$clusterName/setup-awscreds.sh""","""
#!/bin/bash 
sudo echo AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_HERE &amp;gt;&amp;gt; /etc/environment
sudo echo AWS_SECRET_KEY=YOUR_SECRET_KEY_HERE &amp;gt;&amp;gt; /etc/environment
""", true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 20:22:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30169#M21843</guid>
      <dc:creator>cfregly</dc:creator>
      <dc:date>2015-09-10T20:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30170#M21844</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;No. I've just set my env variables in the script. Currently our cluster is in production and I can't test it now. Once I got access I will add some echo and let you know the result&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 12:03:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30170#M21844</guid>
      <dc:creator>samalexg</dc:creator>
      <dc:date>2015-09-11T12:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30171#M21845</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes. I set the env variables as mentioned, but one difference. I've not set it based on cluster. I've added init scripts in dbfs:/databricks/init/ itself? Will that makes the difference?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 12:04:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30171#M21845</guid>
      <dc:creator>samalexg</dc:creator>
      <dc:date>2015-09-11T12:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30172#M21846</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have the same problem. I've added this script and it does not write anything to /etc/environment. The output files from the execution of these scripts are also empty. &lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 23:08:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30172#M21846</guid>
      <dc:creator>TimChan</dc:creator>
      <dc:date>2016-08-12T23:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30173#M21847</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes, its not supported at the moment. We'll make sure to document that! &lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 23:07:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30173#M21847</guid>
      <dc:creator>miklos</dc:creator>
      <dc:date>2016-08-18T23:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30174#M21848</link>
      <description>&lt;P&gt;@Miklos Christine​&amp;nbsp;&amp;nbsp;, is writing variables to /etc/environment not supported, or are session/system wide environment variables not supported at all?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 21:28:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30174#M21848</guid>
      <dc:creator>MikeTrewartha</dc:creator>
      <dc:date>2016-10-20T21:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30175#M21849</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The Init Scripts documentation seem to have moved to: user-guide/advanced/init-scripts.html and are no longer in the AWS Configuration section.&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 21:46:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30175#M21849</guid>
      <dc:creator>kruhly</dc:creator>
      <dc:date>2017-02-27T21:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add environment variable</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30176#M21850</link>
      <description>&lt;P&gt;It is possible! I was able to confirm that the following post's "Best" answer works: &lt;A href="https://forums.databricks.com/questions/11116/how-to-set-an-environment-variable.html" alt="https://forums.databricks.com/questions/11116/how-to-set-an-environment-variable.html" target="_blank"&gt;https://forums.databricks.com/questions/11116/how-to-set-an-environment-variable.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;FYI for @Miklos Christine​&amp;nbsp; and @Mike Trewartha​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 23:16:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-add-environment-variable/m-p/30176#M21850</guid>
      <dc:creator>jric</dc:creator>
      <dc:date>2017-10-16T23:16:15Z</dc:date>
    </item>
  </channel>
</rss>

