Forum Discussion

jmoore11's avatar
jmoore11
Regular Visitor
2 years ago

Scorecard Api with Service Principal

Hello, 

I am able to create a scorecard & goal using the Microsoft.PowerBI.Api version 4.18.0 nuget package in a c# application. I am using the confidential client authentication with a service principal. The service principal has the required authorization to create the scorecard & goal. I have the service principal added to the workspace.

When I navigate to the scorecard in power bi that I created via the service principal / nuget package and try to open the scorecard up, I get an error message like this:

 

I had a power bi admin look at the logs and they see the exact same error that I see. When I open the network tab, I see there is a 404 thrown from https://wabi-us-north-central-f-primary-redirect.analysis.windows.net/v1.0/myOrg/internalScorecards/GetScorecardByReportId(ReportId=GUIDHERE)?$expand=goals($expand=aggregations).

Any ideas as to why this is the case? I can provide the necessary logs if needed but I wasn't sure if they are public facing.


2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI jmoore11,

    Could you please provide more details on the following to further diagnose and troubleshoot the issue?

    For example:

    1. Have you verified that the scorecard is successfully created and visible in the Power BI service (app.powerbi.com) under the correct workspace when logged in with an admin or user account?
    2. Can you confirm the permissions assigned to the Service Principal in the workspace where the scorecard is created?
    3. Is the issue consistent across all scorecards created via the Service Principal, or is it isolated to a specific scorecard?

    How to Get Your Question Answered Quickly  

    Regards,

    Xiaoxin Sheng

    • jmoore11's avatar
      jmoore11
      Regular Visitor

      1. The scorecard is viewable in the UI which is where I am getting the error screenshot from. I am able to retreive information from the scorecard after the API request creates the scorecard. I am also able to get information from the goal after creation.

      2. I have the necessary authorization attributes setup for the service principal.

      3. The issue is consistent for all scorecards created by a service principal. 

      We currently have a work around authenticating a user via MSAL and passing their bearer token to make the API request via nuget package. We would prefer to send user information with our service principal create request to tie them together. Currently, a user has to login in to two different systems to interact with your API which is not ideal.

      Please let me know if you have any other questions or need more information.