<?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: Service Principal Can’t Access Full Query History via queryHistory/list API in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126880#M2556</link>
    <description>&lt;P&gt;The Query History API is scoped to the calling identity, so even with admin rights, service principals can only access their own queries—cross-user access isn't supported.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jul 2025 04:23:01 GMT</pubDate>
    <dc:creator>jhonm_839</dc:creator>
    <dc:date>2025-07-30T04:23:01Z</dc:date>
    <item>
      <title>Service Principal Can’t Access Full Query History via queryHistory/list API</title>
      <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126709#M2549</link>
      <description>&lt;P&gt;I have a weird issue with Databricks.&lt;BR /&gt;I'm using the query history API:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/queryhistory/list" target="_blank"&gt;https://docs.databricks.com/api/workspace/queryhistory/list&lt;/A&gt;&lt;BR /&gt;When I'm using the API with Personal Access Token, it works great.&lt;/P&gt;&lt;P&gt;When i'm using the API with Service Principal, i'm getting only the history of the service principal.&lt;BR /&gt;I made sure that Service Principal has "Can Manage" Permission to the SQL Warehouse.&lt;BR /&gt;In addition, I added the Service Principal to the "admins" group but it didn't help.&lt;/P&gt;&lt;P&gt;This is very critical for one of our customers.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 13:58:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126709#M2549</guid>
      <dc:creator>lio-illumex</dc:creator>
      <dc:date>2025-07-28T13:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Service Principal Can’t Access Full Query History via queryHistory/list API</title>
      <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126847#M2554</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/177000"&gt;@lio-illumex&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Have you applied the filter while making the API call?&lt;BR /&gt;Try adding all target user IDs to the filter_by.user_ids field in your request body—this might help retrieve the full query history you're expecting.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 16:47:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126847#M2554</guid>
      <dc:creator>SP_6721</dc:creator>
      <dc:date>2025-07-29T16:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Service Principal Can’t Access Full Query History via queryHistory/list API</title>
      <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126852#M2555</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/177000"&gt;@lio-illumex&lt;/a&gt;&amp;nbsp;I think the API gets a paginated response. you need to hit the API recursively untill it reached the last page. Loop in until you get&amp;nbsp;&lt;SPAN&gt;next_page_token. I would say the best way is to use the databricks SDK. It is simpler then the APIs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://databricks-sdk-py.readthedocs.io/en/stable/workspace/sql/query_history.html" target="_blank" rel="noopener"&gt;https://databricks-sdk-py.readthedocs.io/en/stable/workspace/sql/query_history.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 17:55:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126852#M2555</guid>
      <dc:creator>nayan_wylde</dc:creator>
      <dc:date>2025-07-29T17:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Service Principal Can’t Access Full Query History via queryHistory/list API</title>
      <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126880#M2556</link>
      <description>&lt;P&gt;The Query History API is scoped to the calling identity, so even with admin rights, service principals can only access their own queries—cross-user access isn't supported.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 04:23:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126880#M2556</guid>
      <dc:creator>jhonm_839</dc:creator>
      <dc:date>2025-07-30T04:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Service Principal Can’t Access Full Query History via queryHistory/list API</title>
      <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126967#M2557</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/156441"&gt;@SP_6721&lt;/a&gt;&amp;nbsp;I don't filter by user ids in both scenarios, it shouldn't matter&lt;BR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/79394"&gt;@nayan_wylde&lt;/a&gt;&amp;nbsp;I also tried with the SDK but it's the same API call behind the scenes. I made sure it's not a pagination issue.&lt;BR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/136937"&gt;@jhonm_839&lt;/a&gt;&amp;nbsp;This is so weird. PAT and SP have the same admin rights.... and the admin PAT can see the SP queries.... I don't understand how it's not possible the other way around&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 15:17:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/126967#M2557</guid>
      <dc:creator>shkolar</dc:creator>
      <dc:date>2025-07-30T15:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Service Principal Can’t Access Full Query History via queryHistory/list API</title>
      <link>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/127006#M2558</link>
      <description>&lt;P&gt;Is your workspace Unity Catalog Enabled? If yes try to give the SPN metastore admin permissions. Hopefully it should resolve the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jul 2025 01:24:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/service-principal-can-t-access-full-query-history-via/m-p/127006#M2558</guid>
      <dc:creator>nayan_wylde</dc:creator>
      <dc:date>2025-07-31T01:24:09Z</dc:date>
    </item>
  </channel>
</rss>

