Forum Discussion

it_russ's avatar
it_russ
Frequent Visitor
6 years ago

Power BI API - Get datasources in group not returning dataflow information

I'm trying to attempt to pull information about the datasources of the datasets through the Power BI API.  I was hoping it would allow me to see which dataflows the report is using as a datasource.  When I pull the information using this API call - https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup

I noticed im only getting information similar to below where it has no reference to the actual dataflow ID or name from the connection details.  Is there another way of pulling this information? or is this just not available through the API yet? Also is there any way to get refresh times of a dataflow? I didnt see that in the API either.

 

I'm currently using PowerShell scripting to pull this kind of information from the workspace since I dont have access at the tenant level to pull this information.

 

    {
      "datasourceType": "Extension",
      "connectionDetails": {
        "path": "PowerBI",
        "kind": "PowerBI"
      },

 

Thanks!

4 Replies

  • v-xuding-msft's avatar
    v-xuding-msft
    Community Support

    Hi it_russ ,

    You could use Get Dataflow Data Sources to get the specific connection details and  Get Dataflows to get a list of all dataflows from the specified workspace which contains dataflow id. And for fresh times, we can only update the refresh times and can't get it.

     

    Best Regards,

    Xue Ding

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • This is something I would be interested in as well.

     

    I'm trying to develop a whole tenant lineage view and being unable to get dataflow sources for the dataset is holding me back. 

     

    If anyone manages to solve this I would appreciate an answer in this thread

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    I am doing something similar to build up a full lineage model and refresh times.

    1. Dataflows linked to Datasets

    Don't know if this is solved yet. But what you need is this API call

     

    https://docs.microsoft.com/en-us/rest/api/power-bi/admin/datasets_getdatasettodataflowslinksingroupasadmin

    You need to be a Power BI service admin to run it.

     

    It returns the dataflows linked to a given dataset.

     

    You can then use

    https://docs.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.data/get-powerbidataflow?view=powerbi-ps

    to get the details of the dataflow.

    2. Dataflow refresh schedules

    There doesn't appear to be an API that will give you this information.

    However if you export the dataflow itself, which can be done by API, (in a JSON format) then in that file is the date and time that entities in dataflows were last refreshed. You can use this information to determine this information. I assume that all refreshes in the last 24 hours are scheduled refreshes.

    I download all the dataflows (which I store in a Git) and then run a powershell script through them all to get the refresh timings.