Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello:
I am just curious if there is an advantage to use HttpClient.SendAsync (C# .Net Core application) to make PowerBI REST API Call , say get report in a group, by utilizing HttpClientFactory to create HttpClient. The reason I am asking is that I could not tell how PowerBIClient is created as demonstrated in most of Sample Projects provided by Microsoft is using
return New PowerBIClient(new Uri(...), new TokenCredentials(accessToken, "Bearer")Will that be reusing HttpClient to avoid known socket exhaustion issues? How is retry being handled with PowerBIClient?
I am using .Net 5 web application to embed reports for our customers and use service principal if that matters. Thank you!
Hi @Anonymous ,
"I am just curious if there is an advantage to use HttpClient.SendAsync (C# .Net Core application) to make PowerBI REST API Call"
What kind of advantages do you mean by 'advantage’?
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Lionel:
It's not really about advantage, it is more about best practice of using httpclient for REST API calls. It does not seem to me that PowerBIClient is using httpclientfactory to create httpclient ,instead it creates an httpclient every time a powerbiclient is created and get disposed everytime. This could cause the known socket exhaustion issue, or no? In addition, I could not find any information if PowerBIClient has any kind of mechnism to do retry kind of thing. Can you help? Thank you
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 8 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |