<?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: Unauthorized 401 API powerbi admin activity events in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4829800#M63138</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1250613"&gt;@v-venuppu&lt;/a&gt;&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried all the above steps,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Created an app in Azure Entra&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Assigned&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Tenant.Read.All, write all roles&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Created Secret&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Created a security group for the Service Principal&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Added Service Principal to Fabric Admin role&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Added the newly created security group in the tenant settings in Power BI admin portal&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;but still getting 401 error. Any suggestions on how to fix it??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: I'm able to access workspace &amp;amp; reports but not able to access activity events&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Sep 2025 14:11:35 GMT</pubDate>
    <dc:creator>PravinPCUK</dc:creator>
    <dc:date>2025-09-18T14:11:35Z</dc:date>
    <item>
      <title>Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4736395#M61873</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use admin activity events api to get views on reports in a workspace. I have created these following activities to provide proper api access:&lt;BR /&gt;-Registered the api&lt;/P&gt;&lt;P&gt;-Gave powerbi application permission api access for tenant.read.all&lt;BR /&gt;-Granted Admin consent&lt;/P&gt;&lt;P&gt;-created a secret&lt;/P&gt;&lt;P&gt;-Modified powerbi tenant setting to allow service principal to call the API&lt;/P&gt;&lt;P&gt;-Created a security group and added my enterprise application in that security group and added that in powerbi tenant settings to call the API&lt;/P&gt;&lt;P&gt;-Even added the enterprise application in Fabric adminstrator role and it still returns 401 unauthorized.&lt;BR /&gt;&lt;BR /&gt;The report level api returns data, but admin activity event doesn't return anything other then 401.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can someone please provide any guidance on what else could I be missing and I am testing the API call in postman to see if it gives me the 200&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 17:56:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4736395#M61873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-18T17:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4736822#M61883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;It looks like you've set up most things correctly, but the 401 Unauthorized error usually comes down to one or two key missing steps.&lt;/P&gt;
&lt;P&gt;Here’s a simple checklist to help you fix it:&lt;/P&gt;
&lt;P&gt;1.Make sure your app has the AuditLog.Read.All permission (not just Tenant.Read.All).&lt;/P&gt;
&lt;P&gt;2.When generating the token, you must request it for Microsoft Graph, not just Power BI(Use Graph API token scope)&lt;/P&gt;
&lt;P&gt;3.Even if the service principal is added in Fabric Admin, the activity events API only works if it's a Power BI Admin (or Global Admin).&lt;/P&gt;
&lt;P&gt;4.Audit data can take up to 24 hours to show up. So if you’re testing with very recent activity, it might return empty even if authorized correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting as solution&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 06:22:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4736822#M61883</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-06-19T06:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4740259#M61944</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided.If the response has addressed your query, please accept it as a solution, so other members can easily find it.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 07:27:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4740259#M61944</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-06-23T07:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4740948#M61953</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1250613"&gt;@v-venuppu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your response and giving me some tips! I tried the steps you mentioned but they didn't give me the 200OK for getactivityevents API. I tried going the delegated permissions route and gave it tenant.read.all and write.all and kept everything else same as I mentioned up there and it worked and now I am getting all of the events for a day! Thank you for providing a repsonse and give me some tips to try out. Would you know if there is a way to get more then one days worth of views metrics from that call or we can only get one day and there is some other work around we have to do?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 13:52:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4740948#M61953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-23T13:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4742226#M61967</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;No, the GetActivityEvents API only supports retrieving one day of data per request.You cannot get multiple days in a single call.&lt;/P&gt;
&lt;P&gt;As a Workaround to get more than one day of metrics, you need to call the API repeatedly, once per day, using different startDateTime and endDateTime values for each date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting as solution&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 11:20:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4742226#M61967</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-06-24T11:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4746019#M62020</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 05:48:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4746019#M62020</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-06-27T05:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4746934#M62032</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/430802"&gt;@VE&lt;/a&gt;&amp;nbsp;I made a python script to loop over the api call to get all events for the past 30 days as you can make 200 api calls in an hour so I am following that process and ingesting my data into azure sql db! Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 18:21:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4746934#M62032</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-27T18:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4748317#M62055</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for sharing the working solution.Please accept the helpful solution as answer so that it will he helpful for others in the community to find the solution easily.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 11:02:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4748317#M62055</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-06-30T11:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4829800#M63138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1250613"&gt;@v-venuppu&lt;/a&gt;&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried all the above steps,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Created an app in Azure Entra&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Assigned&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Tenant.Read.All, write all roles&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Created Secret&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Created a security group for the Service Principal&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Added Service Principal to Fabric Admin role&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Added the newly created security group in the tenant settings in Power BI admin portal&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;but still getting 401 error. Any suggestions on how to fix it??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: I'm able to access workspace &amp;amp; reports but not able to access activity events&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 14:11:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4829800#M63138</guid>
      <dc:creator>PravinPCUK</dc:creator>
      <dc:date>2025-09-18T14:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unauthorized 401 API powerbi admin activity events</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4830367#M63141</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/802501"&gt;@PravinPCUK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;As this thread is already solved, please create a new thread in the forum.We are happy to help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 08:02:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unauthorized-401-API-powerbi-admin-activity-events/m-p/4830367#M63141</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-09-19T08:02:03Z</dc:date>
    </item>
  </channel>
</rss>

