Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I am using Power BI (Microsoft.PowerBI.Api.Models) SDK Model in our C# Application . When we Import report it returns importstate only success or failed but I need some more information in my code like Import Error if ImportState is Failed. How can I get such information.
This is the below piece of code .
When Looking at Import Model Class ,it does not have any property exposed which denotes ImportError .What is the solution to figure out ImportError if ImportState is Failed
Import import = await io.PostImportWithFileAsyncInGroup(GroupID, file, ImportConflictHandlerMode.Abort, cancellationToken: token);
public class Import { public Guid Id { get; set; } public string Name { get; set; } public string ImportState { get; set; } public IList<Report> Reports { get; set; } public IList<Dataset> Datasets { get; set; } public DateTime? CreatedDateTime { get; set; } public DateTime? UpdatedDateTime { get; set; } }
@Anonymous I replied back ,can you help.
Hi @Anonymous ,
It seems to be related to the request information. You can add some try-catch blocks in your code to see the specific error messages. Additionally, check if your method definitions match those in the API package. If they don’t match, the request might not have been sent at all. Finally, make sure the version you are using is not too old, as it might be incompatible with the new version.
NuGet Gallery | Microsoft.PowerBI.Api 4.20.0
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
We have (4.5.0.0) Version of Microsoft.PowerBI.API installed ,there is no change in Import Model in latest 4.20.0.0 also. Problem is in Import Model class there is no property exposed which provides me Error Info about Import . It has a property of ImportState which return status as succedded ,Publishing and Failed but I need to Know the Cause of the ImportState Failed Error.
Adding try catch is not helpful as it does not throw exception when Import is Failed ,it Just returns ImportState as Failed .I refered the GitHub Project also regarding this Microsoft API Model .There is no exposed property which provides us ImportError (PowerBI-CSharp/sdk/PowerBI.Api/Source/Models/Import.cs at master · microsoft/PowerBI-CSharp · GitHub)
Import import = await io.PostImportWithFileAsyncInGroup(WorkspaceID, file, "FILENAME" ImportConflictHandlerMode.CreateOrOverwrite, cancellationToken: token);
import.ImportState --> failed no exception , (no exposed property to understand importerror)
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |