pbirs rest api
7 TopicsReplace data in PBIX file uploaded to PBIRS (on-prem)
In the recent past, I've used the REST API for Power BI (online) to upload a .PBIX file, and then replaced its data on demand in a C# app I've written with new data generated by some data source (the details of which don't matter; it's just a table). Essentially, when I upload the PBIX on Power BI online, it creates two entries, a Report and a Dataset. I submit a new dataset definition, push new rows into that dataset, rebind the report to the new dataset, then delete the old dataset that was created when doing the original upload. That works (after much hair pulling, but that's another story). I now need to do the equivalent with on-prem Power BI Report Server. I managed to use its REST API to upload a PBIX, and I can see it when browsing (or enumerating Power BI Reports with the REST API), but unlike the online version, PBIRS does not automatically split this into a report and dataset. I essentially need to replace the data in the PBIX that was uploaded with new data, just as I did with the online version. Since I don't have these dataset and report objects, I have to assume the process isn't the same. What REST APIs do I need to do this? I tried to start by enumerating whatever datasets might exist after I've uploaded my PBIX as per https://learn.microsoft.com/en-us/rest/api/power-bi-report/data-sets/get-data-set and, while I get a 200 back (all okay), the list is empty. In other words, uploading the PBIX doesn't automatically create a dataset. I was hoping the procedure would be more or less the same...manually create a dataset definition, submit it, then fill it with data, and then bind it back to the report. Is the procedure even the same? Where do I start with this?2KViews0likes3CommentsError to connect and refresh dynatrace rest API in PBI Report Server
Hi All, Hope you're doing well. I am facing a connection problem in dynatrace API with Power BI and I would like to know if you could help me or know anyone that could help me. Just to explain, the code below is working normally in my desktop, I can connect and download the data from Dynatrace API and update the report that I have created. = Json.Document(Web.Contents("https://gmon-payment.group.echonet/e/e594390f-33a0-4016-abba-41d8cc503dca/api/v2/metrics/query?metricSelector=(builtin:host.cpu.usage:avg):names,(builtin:host.mem.usage:avg):names&resolution=1d&from=now/d-1y&to=now/d", [Headers=[Accept="application/json", Authorization=" Api-Token XxXXx.XxXxx"]])) Below is a print with the connection permissions: Type: Anonymous Privacity: None But when I publish it in our Report Server, the problem starts. As the print below, the Authorization didn't save inside the connection string, because the API Token is configurated in the Headers. I have tried many diferent ways to configure the personal Token inside the connection string but I got another error and couldn't connect to the API doing this. The authentication should be Anonymous, but I don't know how can I solve this credential error. I don't know if it needs to be a diferent authorization type, like Oauth2, or a token that isn't personal. As an alternative, once a week I open the report in my desktop, update manually and publish it updated to Report Server. But it should be updated automatically. I have searched during 2 weeks and didn't find any post or youtube video that could help me with this problem. I would be glad if someone could help me to find a soluction. Best Regards.Solved4.1KViews0likes2CommentsPBIRS rest api, data to Power BI report, authentication
Hi, Tried finding something about this issue, but couldn't. Whether someone knows if this has already been answered, please point me in the rights direction. Environment: Power BI Report Server Version1.16.8420.13742(January 2023) What I'm trying to achieve: make a Power BI report listing all the data sources to all Power BI reports in the server, data fetched through https://<server>/reports/api/v2.0 using OData connector Purpose: check if any reports are using an old data source connection, What's working: Getting the complete list of reports from the API through PowerBIReports, after filtering out "My Reports" folders. What's not working: expanding Data Sources for the reports Error message in Power BI Desktop: DataSource.Error: OData: Request failed: The remote server returned an error: (500) Internal Server Error. (An error has occurred.) Error message in Power BI Report Server: ERROR|223|library|Throwing Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: , Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user '<my user account> are insufficient for performing this operation.; Checked: I have put myself as System administrator in the Power BI Report Server security I'm also a sysadmin in the SQL server. Where can I give myself more rights so I can get this working? Are there some stored procedures that are not granted to my account that's needed for these kind of operations? Kind regards, SörenSolved2.5KViews0likes3Commentsprogramatically Modify power bi dataset connections on Post OCT 2020 release - Parameters required?
We need to modify all power bi sharepoint datasources to modify the url in the connection string. I found this link describing how https://docs.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis The method on that page is to create parameterized connections; which, I think would require manual modification of all existing reports. Also, on that page: It says This is also a breaking change on how you could set this up in previous releases. If you're using a pre-October 2020 version of Power BI Report Server, see Change data source connection strings in Power BI reports with PowerShell - Power BI Report Server pre-October 2020 Question: If we are on post Oct 2020, are parameters the only way? I attempted the Pre OCt 2020 method and have been unable to get it to work (explaination in this question) https://community.powerbi.com/t5/Report-Server/ReportingServicesTools-Set-RsRestItemDataSource-BAD-REQUEST-how/m-p/2544542#M243551.9KViews0likes1Commenton-prem (PBIRS) APIs to use for datasources (Paginated, PBI, and shared )
Hi all We are using PBIRS (latest release). I am a report developer and I am being asked to compile a list of username and connect strings, and eventually I'd like to be able to modify the username as well. It seems as if using an API is the best approach and I don't have much experience but I have created 2 scripts (below) and looking for general feedback. My requirements are to Retrieve a list of ALL Datasources ( of all 3 types ) with Connectstring and userID I have built 2 powershell scripts as follows (REST, I believe) $ReportServerURI = "<Reportserverserver>/Reports/" $session = New-RsRestSession -ReportPortalUri $ReportServerURI; $rsItems = Get-RsFolderContent -RsFolder $startingFolder -ReportServerUri $ReportServerURI -Recurse | Where-Object -Property "TypeName" -In "PowerBIReport", "Report"; foreach ($rsitem In $rsItems ) $rds = Get-RsRestItemDataSource -WebSession $session -RsItem $rsitem.Path; foreach ($d in $rds) { $DataSourceUser = $d.DataModelDataSource.Username $datasourceConnectString = $d.DataModelDataSource # I notice the connectstring is in here, so I think I can parse it out. This returns most of the fields for Power BI reports, but I was unable to find the values for paginated (Old SOAP API?) $uri = "Reportserver//ReportServer/ReportService2010.asmx?WSDL" } $reporting = New-WebServiceProxy -uri $uri -UseDefaultCredential -namespace "ReportingWebService" $reports = $reporting.ListChildren($startingFolder, $True) | Where-Object {$_.TypeName -eq "Report"} foreach($report in $reports) { $reportpath = $report.Path $dataSources = $reporting.GetItemDataSources($report.Path) foreach($dataSource in $dataSources) $DataSourceUser = $dataSource.Item.UserName $datasourceConnectString = $dataSource.Item.ConnectString This one seems to get most of the Paginated but not much on the PBI side.. I have read quite a few posts with code samples etc. regarding datasource information but wondering if anyone can explain whether one or the other API should be used for both (noteven sure about shared connections) or if it's possible to get Connectstring/username for both types of report (preferably shared also) Any information or links are appreciated.624Views0likes1CommentGet all subscriptions using REST API returning empty
Hi everyone, I am currently trying to use Powershell to call the REST API endpoint to get all subscriptions based on the following Swagger file: https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Subscriptions/GetSubscriptions This method is currently returning zero subscriptions when I have thousands of them on the server. The method is being executed under the default credentials (my user) and I am an admin of the PBI RS portal. What am I doing incorrectly? Thank you Regards, LS1.9KViews0likes6CommentsPBIRS Rest API Error while getting DataSource by PowerBI Report ID using Powershell
Hi Everyone, I am trying to get DataSource Details associated with Power BI Report(on PBIRS) using Rest API (and Powershell) I referred to API documentation(https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/), the syntax I am using is as below, (Powershell) Syntax used: $ReportUri = "http://pbirsxxx.xxxxxxx.local/reports/api/v2.0/PowerBIReports(xxxxxxxx-3343-4c90-b0d0-xxxxxxxxxxxx)/Datasources" $pbiReports = Invoke-WebRequest -Uri $ReportUri -Method Get -UseDefaultCredentials Output: Invoke-WebRequest : { "error":{ "code":"0","message":"" } } At line:17 char:15 + ... biReports = Invoke-WebRequest -Uri $pbiReportsURI -Method Get -UseDef ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand Please help. Thanks600Views0likes0Comments