Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
nnosaj
Frequent Visitor

Get Data from Web API secured by Azure AD - Could not authenticate with the credentials provided

Hi,

 

I have the following case, and I hope I could get help:

  1. I created a .NET core API without authentication.  Published it to an Azure App service.
  2. That Azure App service is then secured via Active Directory app registration, I followed the (Alternative method) section from this link: https://docs.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad
  3. Now I am trying to create a Power BI report.   Get Data > Other > Web:
  4. get_data_from_web.png
  5. access_web_content_organizational_account.png
  6. When I hit Connect, I get the following error:
  7. authentication_error.png
  8. It is strange that the authentication fails as I use the same credentials when I signed in and got me connected in the first place.  Now when trying to connect to the api to get the data, this happens.  Am I missing something, or not doing it right? I am using the very same credentials in Azure AD.
1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@nnosaj,

I don't think it is possible to directly connect to the web api using AAD authentication, please check if ss78's method works in your scenario.



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
mattmasson
Employee
Employee

Please see Authentication with a data source - Power Query | Microsoft Learn for details on how to make this work. 

v-yuezhe-msft
Employee
Employee

@nnosaj,

I don't think it is possible to directly connect to the web api using AAD authentication, please check if ss78's method works in your scenario.



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yuezhe-msft,

 

Thanks for the suggested method.  I think that would work in my scenario when converted to C#.  However, at present it will be an unnecessary overhead as we had opted for a simpler form of authentication, which is just a simple custom API key authentication, and it worked seamlessly on my Power BI report.  It will be really nice to have Azure AD as authentication if only there could be a more direct and easier approach to it in Power BI.  

 

Kind Regards,

 

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors