Access OData .Net Core API from PowerBI portal

rhofer 1 Reputation point
2022-04-08T08:32:41.583+00:00

We implemented OData Api with Asp.Net Core App (.Net 6). We want to authorize the access with AAD and the OData Connector. Inbetween the Api we used AddJwtBearer Middleware with tenant clientid , clientsecret etc. per documentation. We tried a customer connector like this:

section PQExtension1;
[DataSource.Kind="PQExtension1", Publish="PQExtension1.Publish"] shared OpenPlatform.Feed = Value.ReplaceType(PQExtension1Impl, type function (url as Uri.Type) as any);
PQExtension1Impl = (url as text) => let source = OData.Feed(url)
in source;

PQExtension1 = [ Authentication = [ Aad = [ AuthorizationUri = "https://login.microsoftonline.com/common/oauth2/authorize", Resource = ... ] ], Label = Extension.LoadString("DataSourceLabel") ];
...

This works in PowerBI Desktop. As uncertified Custom Connectors are not supported in PowerBI portal we cannot use it. In PowerBI Portal using Organizational Account with standard OData Connector we get the error: This credential type is not supported.

Is there a way to authorize access to our API with AAD at app.powerbi.com? We tried OAuth but didn't get it running. Could you provide an example what we have to code in our API to get it working?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,237 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,459 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rhofer 1 Reputation point
    2022-04-14T08:46:52.267+00:00

    Thanks for you answer. This really clarifyed the auth error and brought me a big step further.

    My mistake was, that I tested on local machine and PowerBI tries to use the request url as AAD service principal. So I put my test into the cloud and changed the Application ID Url of our App Registration in AAD and it worked with PowerBI Desktop.

    On the other hand I didn't get it running at app.powerbi.com. I'm in contact with PowerBI support on this.

    Thank you very much for your help!

    0 comments No comments