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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rohitpundlik
New Member

Get Data in power Bi from csv file generated from web api

HI All,

 

I have written a web api where we are generating the csv file in which some data will be present. This web api is hosted on azure portal and we have azure AD authentication mechanism if we try to execute any method written in web api. This works fine in browser if i directly executes the api. However, we are trying to consume the same api in power bi but I am getting the below error.

 

invalid_resource: AADSTS50001: The application named was not found in the tenant named . This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.

 Below is short api code where I am returning the resposnse

HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
			response.Content = new StreamContent(ms);
			response.Content.Headers.ContentLength = ms.Length;
			response.Content.Headers.ContentType = new MediaTypeHeaderValue(CsvContentType);
			response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
			response.Content.Headers.ContentDisposition.FileName = Path.GetFileName("myfilename.csv");

			return response;

 

I am executing this api from GetData => Web => enter wep api => then on Organizational Account it ask to enter the credentials where I am putting the organizational credentials. then I am getting the below mention error.

 

So, where I am lacking in this ?

Any help on this appreciated

 

1 REPLY 1
Anonymous
Not applicable

@rohitpundlik,

Directly use Power Query to call the Web API following the guide in Xiaoxin's reply in this similar thread, then check if you get any errors.


Regards,
Lydia

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors