Forum Discussion
PowerBIModelNotFoundException when uploading PBIX
I don't think the REST API pushing data is supposed to work the way you expected for the external users(the ones not in your orginazation). The better approach in your case would be using the being depredicated Power BI Embeded and its Role Level Security feature. Actually I'd suggest you use the new Embedding with non-Power BI users (app owns data) to avoid any migration work from Power BI Embedded after it completely decommissions, it is the replacement for Power BI Embedded, however its RLS feature(may come soon) is not yet available.
So in my opinon, as you have access to read your customers data, you can
- Read the data and archive it somewhere like a local/cloud database.
- Design a pbix with RLS configuration and publish it to Power BI workspace.
- Embedded the report in a 3rd party site and share the site page to your customers. The customers could see the data from their own orginaztion is RLS is configured well in pbix and the embedded accesstoken(see in the RLS link.)
> as you have access to read your customers data
Actually I probably haven't made this entirely clear. My app, a standard Win32 desktop app that ships with my .PBIX file on disk, has access to my customers' data because they all install it in their own environment - *I* do not have access to that data remotely. I can't see it, I can't access it, I can't customize reports around it. But, the data comes from a common source my app (installed in their environment) can read and understand.
Anyway, I managed to work around the problem I was having as follows. It's a bit of a kludge, but it seems to fill my purposes and seems to work reliably:
I redid my .PBIX file with a dataset set up to point to a local database. This obviously won't work in my customers' environments, but no matter. I designed my reports around this data, and saved everything to disk as a .PBIX.
My Win32 app now uses the REST API to:
- POST my PBIX in whatever account the user used to login
- Get the dataset ID (call it "InitialDS")
- POST a dataset definition as a JSON string, which simply matches the one that now already exists
- Get its dataset ID (call it "NewDS")
- Rebind the report to "NewDS", as per https://msdn.microsoft.com/en-us/library/mt784672.aspx
- Delete "InitialDS"
At this stage, I have one dataset, one report, and from that point forward my app can POST new rows to that dataset at it pleases.
I'd love to hear some thoughts. Am I doing something insane that might break in the future?