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

C#: PowerBI client returns The operation was canceled error when executing GetReportsAsync method

I have created a Power BI utility which includes rest calls using Power BI client in C#.

When I checked logs of my utility, Power BI client returning below error sometimes without any reason and the utility is failing because of this error

The operation was canceled.

 

I would like to know if there is any issue with Power BI client 

Status: Investigating

Hi @Anonymous ,

 

I apologize for not being very clear on the details of your question, but I found something that seems similar to your question that may help you.

async await - C# : OperationCanceledException : The operation was canceled - Stack Overflow

 

Best regards,

Community Support Team Selina zhu

Comments
v-mengzhu-msft
Community Support
Status changed to: Investigating

Hi @Anonymous ,

 

I apologize for not being very clear on the details of your question, but I found something that seems similar to your question that may help you.

async await - C# : OperationCanceledException : The operation was canceled - Stack Overflow

 

Best regards,

Community Support Team Selina zhu

Anonymous
Not applicable

Hello @v-mengzhu-msft ,

 

My Azure function is failing sometimes and I am not able to understand the reason behind this.

 

The execution flow of the Azure function is shown as below:

GetAccessToken -> CreatePowerBIClient -> ExportPowerBIReports


When I checked the logs of my Azure function, It is containing few failures.

Exception: System.AggregateException
Message: One or more errors occurred. (An error occurred while sending the request.)

This Exception is occuring exactly when I called "clientApp.AcquireTokenForClient(scopes).ExecuteAsync().Result" to get Azure AD token for service principal

 

In some other cases, I am getting the below exception message when trying to retrieve the PowerBIReports using PowerBIClient

" Client.Reports.GetReportsAsync"

Exception: TaskCanceledException

Message: The operation was canceled.

I would like to know if there is any issue with Power BI client in .NET

v-mengzhu-msft
Community Support

Hi @Anonymous ,

Based on the above information, if you are a Power BI Pro licensee, you can create a support ticket for free and a dedicated Microsoft engineer will come to solve the problem for you.

It would be great if you continue to share in this issue to help others with similar problems after you know the root cause or solution.

The link of Power BI Support: Support | Microsoft Power BI

For how to create a support ticket, please refer to How to create a support ticket in Power BI - Microsoft Power BI Community

 

Best regards,

Community Support Team Selina zhu