Access OData .Net Core API from PowerBI portal

rhofer 1 Reputation point

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 = "", 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 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?

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,748 questions
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.
8,199 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rhofer 1 Reputation point

    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 I'm in contact with PowerBI support on this.

    Thank you very much for your help!

    0 comments No comments