<?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: Issue with databricks.sdk - AccountClient Service Principals API in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120714#M46238</link>
    <description>&lt;P&gt;Same here, couldnt find clear details on what needs to be passed, but this worked for me:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; databricks.sdk &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; AccountClient&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;a &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;AccountClient&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;host&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;A href="https://accounts.cloud.databricks.com" target="_blank" rel="noopener"&gt;https://accounts.cloud.databricks.com&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;ACCOUNT_ID&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;client_id&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;CLIENT_ID&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;client_secret&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;SECRET&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; user &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; a.users.&lt;/SPAN&gt;&lt;SPAN&gt;list&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;'userName eq "&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;user_email&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(user)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 02 Jun 2025 12:28:31 GMT</pubDate>
    <dc:creator>Pat</dc:creator>
    <dc:date>2025-06-02T12:28:31Z</dc:date>
    <item>
      <title>Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106738#M42569</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’ve been trying to work with the databricks.sdk Python library to manage service principals programmatically. However, I’m running into an issue when attempting to create a service principal using the AccountClient class. Below is the code snippet I’m using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient, AccountClient
import time

account_client = AccountClient()

sp_create = account_client.service_principals.create(active=True, display_name=f'sdk-{time.time_ns()}')

sp = account_client.service_principals.get(id=sp_create.id)

# cleanup
account_client.service_principals.delete(id=sp_create.id)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;The Problem&lt;/H3&gt;&lt;P&gt;When I execute the above code, I encounter the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NotFound                                  Traceback (most recent call last)
Cell In[12], line 1
----&amp;gt; 1 sp_create = account_client.service_principals.create(active=True, display_name=f'sdk-{time.time_ns()}')

File ~/.pyenv/versions/3.8.13/lib/python3.8/site-packages/databricks/sdk/service/iam.py:2257, in AccountServicePrincipalsAPI.create(self, active, application_id, display_name, entitlements, external_id, groups, id, roles, schemas)
...
NotFound: Endpoint not found for /2.0/accounts/ACCOUNT_ID/scim/v2/ServicePrincipals&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;Observations&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;The error indicates a NotFound issue, specifically stating that the endpoint /2.0/accounts/{account_id}/scim/v2/ServicePrincipals could not be found.&lt;/LI&gt;&lt;LI&gt;I suspect the AccountClient might not be properly configured or the SDK might not support this operation for my Databricks environment.&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Environment Details&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Python version: 3.8.13&lt;/LI&gt;&lt;LI&gt;Databricks SDK version: databricks.sdk (latest version from PyPI)&lt;/LI&gt;&lt;LI&gt;Databricks environment: AWS Databricks&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Questions&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;Has anyone successfully used the AccountClient class to manage service principals?&lt;/LI&gt;&lt;LI&gt;Is there any additional configuration or permissions required to use this API?&lt;/LI&gt;&lt;LI&gt;Could this be a versioning issue with the SDK or API endpoint?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any insights or guidance would be greatly appreciated. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 02:21:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106738#M42569</guid>
      <dc:creator>Asaph</dc:creator>
      <dc:date>2025-01-23T02:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106853#M42614</link>
      <description>&lt;P&gt;I am facing the same issue&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 21:26:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106853#M42614</guid>
      <dc:creator>Csoni</dc:creator>
      <dc:date>2025-01-23T21:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106857#M42615</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/145460"&gt;@Asaph&lt;/a&gt;, this could be an authentication or missing configuration issue. Please ensure that the &lt;SPAN class="s1"&gt;AccountClient&lt;/SPAN&gt; class instance is created with the required authentication details. Additionally, since this is an account-level operation, check you have account admin privileges to run it successfully.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1"&gt;Example code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;from databricks.sdk import WorkspaceClient, AccountClient
import time

account_client = AccountClient(
    host='', # databricks account console host
    account_id='', # databricks account id
    # authentication options 
    # client_id/client_secret best practice
    client_id='',
    client_secret=''
)

sp_create = account_client.service_principals.create(active=True, display_name=f'sdk-{time.time_ns()}')

sp = account_client.service_principals.get(id=sp_create.id)

# cleanup
account_client.service_principals.delete(id=sp_create.id)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="4"&gt;Mark as resolved if this solves your issue.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 22:57:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106857#M42615</guid>
      <dc:creator>andres_garcia</dc:creator>
      <dc:date>2025-01-23T22:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106871#M42619</link>
      <description>&lt;P&gt;This can be a problem with missing configuration or authentication. Please make sure that the necessary authentication information is included when creating the AccountClient class instance. Additionally, make sure you have account admin capabilities to do this operation correctly, as it is account-level.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 05:56:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/106871#M42619</guid>
      <dc:creator>nick533</dc:creator>
      <dc:date>2025-01-24T05:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/107050#M42687</link>
      <description>&lt;P&gt;This can be an issue with authentication or configuration being missing. When constructing the AccountClient class instance, please ensure that the required authentication details are present. Additionally, since this action is account-level, make sure you have account admin skills to complete it successfully.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 09:26:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/107050#M42687</guid>
      <dc:creator>nick533</dc:creator>
      <dc:date>2025-01-26T09:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120619#M46210</link>
      <description>&lt;P&gt;What are the authentication details that needs to be passed while constructing accountclient. Cant find clear working examples of account client within notebook&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 16:02:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120619#M46210</guid>
      <dc:creator>GangaGogga</dc:creator>
      <dc:date>2025-05-30T16:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120714#M46238</link>
      <description>&lt;P&gt;Same here, couldnt find clear details on what needs to be passed, but this worked for me:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; databricks.sdk &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; AccountClient&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;a &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;AccountClient&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;host&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;A href="https://accounts.cloud.databricks.com" target="_blank" rel="noopener"&gt;https://accounts.cloud.databricks.com&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;ACCOUNT_ID&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;client_id&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;CLIENT_ID&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;client_secret&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;lt;SECRET&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; user &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; a.users.&lt;/SPAN&gt;&lt;SPAN&gt;list&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;'userName eq "&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;user_email&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(user)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Jun 2025 12:28:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120714#M46238</guid>
      <dc:creator>Pat</dc:creator>
      <dc:date>2025-06-02T12:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120730#M46242</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/59366"&gt;@Pat&lt;/a&gt;.&amp;nbsp;What permissions does the spn needs to have as I get&amp;nbsp;&lt;SPAN&gt;invalid_client: Client authentication failed&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 16:06:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/120730#M46242</guid>
      <dc:creator>GangaGogga</dc:creator>
      <dc:date>2025-06-02T16:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with databricks.sdk - AccountClient Service Principals API</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/138860#M51027</link>
      <description>&lt;P&gt;I am using the Python SDK and to authenticate I am using a SP and a Secret. Here is the code that worked for me in Azure Databricks notebook.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from databricks.sdk import AccountClient

acct_client = AccountClient(
    host="https://accounts.azuredatabricks.net", 
    account_id=&amp;lt;account_id&amp;gt;, 
    azure_tenant_id=&amp;lt;tenant_id&amp;gt;, 
    azure_client_id=&amp;lt;client_id&amp;gt;, 
    azure_client_secret=&amp;lt;client_secret&amp;gt;
)

for g in acct_client.groups.list():
    print(g)&lt;/LI-CODE&gt;&lt;P&gt;References:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://databricks-sdk-py.readthedocs.io/en/latest/authentication.html#databricks-native-authentication" target="_blank"&gt;https://databricks-sdk-py.readthedocs.io/en/latest/authentication.html#databricks-native-authentication&lt;/A&gt;&lt;/LI&gt;&lt;LI&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;/LI&gt;&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/dev-tools/auth/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 06:41:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-databricks-sdk-accountclient-service-principals-api/m-p/138860#M51027</guid>
      <dc:creator>MarlonFojas</dc:creator>
      <dc:date>2025-11-13T06:41:21Z</dc:date>
    </item>
  </channel>
</rss>

