Forum Discussion

alietzau's avatar
alietzau
Frequent Visitor
7 years ago
Solved

Running Graph API queries

To start, the queries that I would like to run are: 

 

I have tried many different ways to try and get the information from this query. I know it works in Graph Explorer, I tried to run it using Postman (Instructions from Microsoft) and the query doesn't work with the AAD App I made. I've tried to use the Microsoft Graph Security connector, but I can only use certain queries (e.g. https://graph.microsoft.com/v1.0/me/licenseDetails).  There's another thread where they discuss how to pull data from Graph API into powerBI, but the guide was published a year ago and many of the links in it are broken. I've tried to talk to different people about how to pull in the data from Graph API but I haven't heard anything super helpful. They told me to use generic REST API calls to run the query, but I don't know how to handle access tokens with PowerBI.

 

There's a lot that I've tried here and I'm surprised that this isn't easier since Graph API is so useful. If I can get the help I need to run just one query, I'm sure I'll be able to use the same process for the other queries and I'll be able to produce a project that is useful for our entire community.

  • ImkeF's avatar
    ImkeF
    7 years ago

    I would also prefer that this would be easier.

    Currently you have to:

    1) use a custom connector and

    2) create an app in the azure portal that handles the authentication for the connector

     

    With my connector, I'm able to see the license details. Unfortunately I cannot add the permissions for the subcriptions to the app, as that's a preview feature currently. 

     

    Please let me know if you want to proceed just for the license details and I can provide further help on how to implement the connector. Am I getting it right that you have registered you app successfully already?

  • ImkeF's avatar
    ImkeF
    7 years ago

    Hi alietzau ,

    great - thanks for the tip - that worked for me as well! Actually, didn't have to clear my other permissions fortunately.

     

    You can try my connector. The enclosed zip includes all files necessary. You have to perform the following steps:

    1) Unzip it

    2) edit client_id: replace content by the client id of your app

    3) edit client_secret: replace content by the client secret of you app

    4) zip all files back and rename the zip to "MyGraphB.mez"

    5) Copy that file into your Power BI Desktop-folder: C:\Users\<YourUserName>\Documents\Power BI Desktop\Custom Connectors

     

    Now, when you type in "mygr" for example, these 2 items should show up:

     

    Choose the latter ("MyGraphB2.WebContents") and paste the URL of your choice.

    If interested, I've described the Web.Contents-addition here: https://www.thebiccountant.com/2019/04/17/graph-api-custom-connector-power-bi/

     

     

12 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi alietzau ,

    It seems that you want to use the Graph API  as the data source in power bi desktop.

    If that is the case, please refer to this similar thread which has been solved firstly.

    If you need other help, please feel free to ask.

    Best Regards,

    Cherry

    • alietzau's avatar
      alietzau
      Frequent Visitor

      v-piga-msft The post that you linked is the same as the one that I refer to in my original post. The guide that they link to is not a step by step guide and it is hard to follow what they are trying to do and where the powerquery goes. Many of the links for supporting material in that same guide are broken, it's hard to investigate this issue. There are also users at the end of that post that mention that they are still having issues after looking into this for months. 

       

      I think that Graph API is a powerful resource to have and it's a shame that the PowerBI community doesn't have a clear way to pull in the information from it. I think if we resolve this, we can help the community by creating powerful dashboards without the need for third party tools. 

      • ImkeF's avatar
        ImkeF
        Icon for Community Champion rankCommunity Champion

        I would also prefer that this would be easier.

        Currently you have to:

        1) use a custom connector and

        2) create an app in the azure portal that handles the authentication for the connector

         

        With my connector, I'm able to see the license details. Unfortunately I cannot add the permissions for the subcriptions to the app, as that's a preview feature currently. 

         

        Please let me know if you want to proceed just for the license details and I can provide further help on how to implement the connector. Am I getting it right that you have registered you app successfully already?

  • alietzau's avatar
    alietzau
    Frequent Visitor

    ImkeF , I hope you don't mind if I keep pestering you, but I've tried to run queries that involve more than 100 returns, so it gives me a @odata.nextlink value. Do you know how I can get PowerBI to retreave the next 100 values? I haven't seen any discussion on this with PowerBI in mind.