<?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: Azure Databricks databricks-cli authentication with M2M using environment variables in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/127145#M3791</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104610"&gt;@ashraf1395&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to use &lt;STRONG&gt;environment variables&lt;/STRONG&gt; to configure the &lt;STRONG&gt;Databricks CLI&lt;/STRONG&gt;, instead of relying on the .databrickscfg file.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/154409"&gt;@Chris2794&lt;/a&gt;&amp;nbsp;Have you found a way to authenticate using &lt;STRONG&gt;Machine-to-Machine (M2M) OAuth with Microsoft Entra ID managed service principals&lt;/STRONG&gt; via environment variables?&lt;/P&gt;&lt;P&gt;I’m currently working on a similar scenario and would appreciate any insights.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 03:42:38 GMT</pubDate>
    <dc:creator>Prakazsh</dc:creator>
    <dc:date>2025-08-01T03:42:38Z</dc:date>
    <item>
      <title>Azure Databricks databricks-cli authentication with M2M using environment variables</title>
      <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/113131#M3158</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Which environment variables do I have to set to use the databricks-cli with m2m oauth using Microsoft Entra ID managed service principals? I already added the service principal to the workspace.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found the following documentation, but I am still confused why it does not work:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/azure-sp" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/azure-sp&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I set the env vars&amp;nbsp;DATABRICKS_HOST,&amp;nbsp;ARM_TENANT_ID,&amp;nbsp;ARM_CLIENT_ID and&amp;nbsp;ARM_CLIENT_SECRET,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;but when I try to run some command, I still get the error:&lt;BR /&gt;Error: InvalidConfigurationError: You haven't configured the CLI yet! Please configure by entering `/home/airflow/.local/bin/databricks configure`&lt;BR /&gt;&lt;BR /&gt;I will use env vars instead of config files as it should be part of an airflow CI/CD pipeline&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 11:19:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/113131#M3158</guid>
      <dc:creator>Chris2794</dc:creator>
      <dc:date>2025-03-20T11:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Azure Databricks databricks-cli authentication with M2M using environment variables</title>
      <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/113163#M3159</link>
      <description>&lt;P&gt;&amp;nbsp;I would suggest to create .databrickscfg profile ,best practice and most easy&lt;/P&gt;&lt;P&gt;You will need to create it in your ~ directory vim ~/.databrickscfg&lt;BR /&gt;inside the file you can define multiple profiles like this&amp;nbsp;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/azure-sp" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/azure-sp&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# For account level access 
[&amp;lt;some-unique-configuration-profile-name&amp;gt;]
host                = &amp;lt;account-console-url&amp;gt;
account_id          = &amp;lt;account-id&amp;gt;
azure_tenant_id     = &amp;lt;azure-service-principal-tenant-id&amp;gt;
azure_client_id     = &amp;lt;azure-service-principal-application-id&amp;gt;
azure_client_secret = &amp;lt;azure-service-principal-client-secret&amp;gt;

# For workspace level access
[&amp;lt;some-unique-configuration-profile-name&amp;gt;]
host                = &amp;lt;workspace-url&amp;gt;
azure_tenant_id     = &amp;lt;azure-service-principal-tenant-id&amp;gt;
azure_client_id     = &amp;lt;azure-service-principal-application-id&amp;gt;
azure_client_secret = &amp;lt;azure-service-principal-client-secret&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;After filling all these values you can test once whether your configurations are correctly set or not with this command&amp;nbsp;&lt;BR /&gt;'databricks configure'&amp;nbsp; all you profiles mentioned in your .databrickscfg will be checked whether their configuration is correct or not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then you can run any databricks cli command along with this global argument -p&amp;nbsp; or --profile &amp;lt;profile-name&amp;gt;&lt;/P&gt;&lt;P&gt;Like databricks bundle deploy -p &amp;lt;profile-name&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By default your can set your .databrickscfg file is set to ~ path but you can also specify it in any other directory for that you can set an environment variable. More info on it here :&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/dev-tools/auth/unified-auth#config-profiles" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/auth/unified-auth#config-profiles&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 15:04:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/113163#M3159</guid>
      <dc:creator>ashraf1395</dc:creator>
      <dc:date>2025-03-20T15:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Azure Databricks databricks-cli authentication with M2M using environment variables</title>
      <link>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/127145#M3791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104610"&gt;@ashraf1395&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to use &lt;STRONG&gt;environment variables&lt;/STRONG&gt; to configure the &lt;STRONG&gt;Databricks CLI&lt;/STRONG&gt;, instead of relying on the .databrickscfg file.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/154409"&gt;@Chris2794&lt;/a&gt;&amp;nbsp;Have you found a way to authenticate using &lt;STRONG&gt;Machine-to-Machine (M2M) OAuth with Microsoft Entra ID managed service principals&lt;/STRONG&gt; via environment variables?&lt;/P&gt;&lt;P&gt;I’m currently working on a similar scenario and would appreciate any insights.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 03:42:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/azure-databricks-databricks-cli-authentication-with-m2m-using/m-p/127145#M3791</guid>
      <dc:creator>Prakazsh</dc:creator>
      <dc:date>2025-08-01T03:42:38Z</dc:date>
    </item>
  </channel>
</rss>

