<?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 use Databricks CLI as a service principal? in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95457#M2136</link>
    <description>&lt;P&gt;Thank you for your reply. However, I refer to this&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/authentication#azure-sp-auth" target="_blank"&gt;Authentication for the Databricks CLI - Azure Databricks | Microsoft Learn - Microsoft Entra ID service principal authentication&lt;/A&gt;. This is for authentication using Microsoft Entra ID's client id and secret.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlbertWang_0-1729593900588.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12149i6826E205182D3649/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlbertWang_0-1729593900588.png" alt="AlbertWang_0-1729593900588.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The one you mentioned is&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/authentication#m2m-auth" target="_blank"&gt;Authentication for the Databricks CLI - Azure Databricks | Microsoft Learn - OAuth machine-to-machine (M2M) authentication&lt;/A&gt;&amp;nbsp;As I understand, this is for authentication using Databricks Service Principal client id and secret.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlbertWang_1-1729593950045.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12150i4BFC1D812B80F661/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlbertWang_1-1729593950045.png" alt="AlbertWang_1-1729593950045.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2024 10:46:09 GMT</pubDate>
    <dc:creator>AlbertWang</dc:creator>
    <dc:date>2024-10-22T10:46:09Z</dc:date>
    <item>
      <title>How to use Databricks CLI as a service principal?</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95434#M2133</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a question about how to use&amp;nbsp;Databricks CLI on my local environment as a service principal?&lt;/P&gt;&lt;P&gt;I have installed Databricks CLI and configured the file `.databrickscfg` as shown below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DEFAULT]
host      = https://adb-123123123.1.azuredatabricks.net
auth_type = databricks-cli

[devsp]
host                = https://adb-123123123.1.azuredatabricks.net
azure_tenant_id     = &amp;lt;my-azure-tenant-id&amp;gt;
azure_client_id     = &amp;lt;my-ms-entra-id-service-principal-client-id&amp;gt;
azure_client_secret = &amp;lt;my-ms-entra-id-service-principal-client-secret&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use Microsoft Entra ID service principal and added the service principal to the Databricks workspace.&lt;/P&gt;&lt;P&gt;However, when I run the command `databricks current-user me -p devsp`, I still see my personal user information. When I run the command `databricks tokens create -p devsp`, I still create a PAT for my personal user.&lt;/P&gt;&lt;P&gt;Any help will be appreciated!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Albert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 09:11:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95434#M2133</guid>
      <dc:creator>AlbertWang</dc:creator>
      <dc:date>2024-10-22T09:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Databricks CLI as a service principal?</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95453#M2135</link>
      <description>&lt;P&gt;I assume, you want to connect for account-level operation, then the configuration&lt;SPAN&gt; in your &lt;/SPAN&gt;.databrickscfg&lt;SPAN&gt; file&lt;/SPAN&gt;&amp;nbsp;looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[&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;
client_id     = &amp;lt;service-principal-client-id&amp;gt;
client_secret = &amp;lt;service-principal-oauth-secret&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;For workspace-level&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;commands, set the following values in your &lt;/SPAN&gt;.databrickscfg&lt;SPAN&gt; file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[&amp;lt;some-unique-configuration-profile-name&amp;gt;]
host          = &amp;lt;workspace-url&amp;gt;
client_id     = &amp;lt;service-principal-client-id&amp;gt;
client_secret = &amp;lt;service-principal-oauth-secret&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also: &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/authentication" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/authentication&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 10:34:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95453#M2135</guid>
      <dc:creator>Stefan-Koch</dc:creator>
      <dc:date>2024-10-22T10:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Databricks CLI as a service principal?</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95457#M2136</link>
      <description>&lt;P&gt;Thank you for your reply. However, I refer to this&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/authentication#azure-sp-auth" target="_blank"&gt;Authentication for the Databricks CLI - Azure Databricks | Microsoft Learn - Microsoft Entra ID service principal authentication&lt;/A&gt;. This is for authentication using Microsoft Entra ID's client id and secret.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlbertWang_0-1729593900588.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12149i6826E205182D3649/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlbertWang_0-1729593900588.png" alt="AlbertWang_0-1729593900588.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The one you mentioned is&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/authentication#m2m-auth" target="_blank"&gt;Authentication for the Databricks CLI - Azure Databricks | Microsoft Learn - OAuth machine-to-machine (M2M) authentication&lt;/A&gt;&amp;nbsp;As I understand, this is for authentication using Databricks Service Principal client id and secret.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlbertWang_1-1729593950045.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12150i4BFC1D812B80F661/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlbertWang_1-1729593950045.png" alt="AlbertWang_1-1729593950045.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 10:46:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95457#M2136</guid>
      <dc:creator>AlbertWang</dc:creator>
      <dc:date>2024-10-22T10:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Databricks CLI as a service principal?</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95535#M2138</link>
      <description>&lt;P&gt;got you.&lt;BR /&gt;&lt;BR /&gt;I found a working solution. Try this one:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[devsp]
azure_workspace_resource_id = /subscriptions/bc0cd1..././.../Databricks/workspaces/my-workspace
azure_tenant_id             = bc0cd1...
azure_client_id             = fa0cd1...
azure_client_secret         = aBC1D~...&lt;/LI-CODE&gt;&lt;P&gt;worked for me:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cli.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12175i7A5AD4F2A029BE08/image-size/large?v=v2&amp;amp;px=999" role="button" title="cli.png" alt="cli.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 15:45:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95535#M2138</guid>
      <dc:creator>Stefan-Koch</dc:creator>
      <dc:date>2024-10-22T15:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Databricks CLI as a service principal?</title>
      <link>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95601#M2139</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;Stefan-Koch. Your solution works.&lt;/P&gt;&lt;P&gt;Interesting, the document mentions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlbertWang_0-1729625428812.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12213iE3FBCD445B6E0153/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlbertWang_0-1729625428812.png" alt="AlbertWang_0-1729625428812.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I thought the targe identity indicates the service principal, and I have added the service principal to the databricks workspace. However, either my understanding is wrong, or the document is incorrect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 19:32:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/how-to-use-databricks-cli-as-a-service-principal/m-p/95601#M2139</guid>
      <dc:creator>AlbertWang</dc:creator>
      <dc:date>2024-10-22T19:32:01Z</dc:date>
    </item>
  </channel>
</rss>

