Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Get Data from pbix publish in PowerBi Report Server

Hi all,

i've this issue:

i need to get the data (or graph) contained in a PowerBi dashboard.

The pbix. report is published directly in PowerBi Report Server (i don't use Microsoft cloud).

Is it possible to get data or graph using powershell?

Thanks in advance,

Daniele

2 Replies

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Getting report data

    Reports sent to the pull server are entered into a database on the server. The reports are available through calls to the web service. To retrieve reports for a specific node, send an HTTP request to the report web service in the following form:

    http://CONTOSO-REPORT:8080/PSDSCReportServer.svc/Nodes(AgentId='MyNodeAgentId')/Reports

    Where MyNodeAgentId is the AgentId of the node for which you want to get reports. You can get the AgentID for a node by calling Get-DscLocalConfigurationManager on that node.

    The reports are returned as an array of JSON objects.

    The following script returns the reports for the node on which it is run:

     

    function GetReport
    {
        param
        (
            $AgentId = "$((glcm).AgentId)",
            $serviceURL = "http://CONTOSO-REPORT:8080/PSDSCPullServer.svc"
        )
    
        $requestUri = "$serviceURL/Nodes(AgentId= '$AgentId')/Reports"
        $request = Invoke-WebRequest -Uri $requestUri  -ContentType "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" `
                   -UseBasicParsing -Headers @{Accept = "application/json";ProtocolVersion = "2.0"} `
                   -ErrorAction SilentlyContinue -ErrorVariable ev
        $object = ConvertFrom-Json $request.content
        return $object.value
    }

     

    refer:

    Get report data

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Lucien,

      first of all thanks for you reply.

      With the powershell i 2 problem:

      1) i can't recover the "AgentId" and i haven't (or i don't know how to reach it) the PSDSCPULLServer;

      2)  with this powershell i can't get graph directly from the report.

      Can you help me in these issue?

      Thanks,

      Daniele