migueesc123 / PowerBIRESTAPI

A Microsoft Power BI Data Connector or Power Query Connector for the Power BI REST API
MIT License
237 stars 74 forks source link

Include Workspace ID with Apps #129

Closed relax528 closed 1 year ago

relax528 commented 2 years ago

Is it possible to include Workspace ID when retrieving a list of Apps. The name can change so it's no longer in alignment with the Workspace name. Thanks

klinejordan commented 2 years ago

The Apps As Admin REST APIs don't include Workspace ID, and really Apps are related to Reports, not workspaces. And while I'm sure that the workspace-level APIs return the appId field, I'm not 100% sure if the GetGroupsAsAdmin reports array includes the appId field. I'm on parental leave for a few months, so am not in a position to check. But if the GetGroupsAsAdmin reports array includes appId, it's certainly possible to derive workspace ID from report ID.

relax528 commented 2 years ago

First of all, congrats! Enjoy the time with your growing family. Apps do have to do with reports and dashboards, but they live in a workspace (and someday maybe more than one) and when looking at permissions (currently doing a massive cleanup), workspace users present no differently in AppUsers than someone with permission to the app as an individual, I've been able to backdoor it, just was wondering if there wasn't a more straight forward method. Thanks and enjoy your time off!

klinejordan commented 2 years ago

Thanks! An yes, technically apps are related to workspaces but only indirectly, through reports and dashboards in the workspace. In the REST API, the appId foreign key is only present in arrays for dashboards and reports, not workspaces.

I'll leave this open until I get back but if appId is returned by GetGroupsAsAdmin, it should be an easy fix

migueesc123 commented 2 years ago

@klinejordan is it part of the GetGroupsAsAdmin?

klinejordan commented 2 years ago

It is, the field is called appId and just needs to be added to the record expansion for both dashboards and reports.

klinejordan commented 1 year ago

Closed with #146