Forum Discussion
how to get data about users from powerbi rest api without been administrator
- 1 year ago
Thank you for this overview.
I still have a question when you say :
"Set up a separate service principal account with the required role and permissions, and use that identity for your API calls."
I do not understand beacause when a make ma api call, i use my service principal informations to get data.Here this is my python witch give me the token :
import msalimport requestsimport pandas as pd# === Paramètres ===TENANT_ID = 'my tenant id'CLIENT_ID = 'my client id of my enterprise application'CLIENT_SECRET = 'My secret '# === Authentification ===def get_graph_access_token():app = msal.ConfidentialClientApplication(client_id=CLIENT_ID,client_credential=CLIENT_SECRET)result = app.acquire_token_for_client(scopes=GRAPH_SCOPE)if "access_token" in result:return result['access_token']else:raise Exception(f"Échec de l'authentification : {result}")# === Script principal ===if __name__ == "__main__":token = get_graph_access_token()With this a can get data for microsoft graph api in is v1.0 version but for the auditlog i need to use the beta version and at this time i receive a error.
So if i understand i receive a token witch is connecting to my service principal so in this case a should not have error of permissions ?
Do i understand correct ?
If not coult you give me the solution to use my service principal correcty ?
Thank you Poojara_D12 - 1 year ago
HI Toi69___ ,
I have included the previously resolved thread and learning documents. They may help you resolve the issue
We truly appreciate your continued engagement and thank you for being an active and valued member of the community.
If you're still experiencing any challenges, please don’t hesitate to reach out we’d be more than happy to assist you further.
We look forward to hearing from you.
Best regards,
LakshmiSolved: Re: Extracting power BI Usage logs without powerBI... - Microsoft Fabric Community
Microsoft Graph permissions reference - Microsoft Graph | Microsoft Learn
Important information, i do not have a administrator role.
Then you will not have access to these API endpoints.