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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
zaxbysdt
Regular Visitor

C# 5.1 API SDK missing error object from exports

It would appear that the Microsoft.PowerBI.Api 5.1.0 SDK for .NET has removed the Error object from the Export model. 

 

Here's a raw response from Postman calling the https://api.powerbi.com/v1.0/myorg/groups/xxx/reports/xxx/exports/xxx endpoint, with my specific GUIDs replaced with xxx. Note the error object with code, message, and detail properties.

{
    "@odata.context": "https://wabi-us-east2-d-primary-redirect.analysis.windows.net/v1.0/myorg/groups/xxx/$metadata#exports/$entity",
    "id": "xxx",
    "createdDateTime": "2026-06-25T13:18:35.0382337Z",
    "lastActionDateTime": "2026-06-25T13:18:39.7605289Z",
    "reportId": "xxx",
    "reportName": "xxx",
    "status": "Failed",
    "error": {
        "code": "Invalid_Report_Parameters",
        "message": "RootActivityId(xxx): One of the supplied report parameter names does not exist.",
        "details": []
    },
    "percentComplete": 0,
    "expirationTime": "0001-01-01T00:00:00Z"
}

 

However, the Export object modeled in the SDK library (Export.cs) omits the error property entirely:

using System;
using System.Text.Json;
using Azure;

namespace Microsoft.PowerBI.Api.Models;

public class Export
{
    public string Id { get; }

    public DateTimeOffset? CreatedDateTime { get; }

    public DateTimeOffset? LastActionDateTime { get; }

    public Guid? ReportId { get; }

    public string ReportName { get; }

    public ExportState? Status { get; }

    public int? PercentComplete { get; }

    public string ResourceLocation { get; }

    public string ResourceFileExtension { get; }

    public DateTimeOffset? ExpirationTime { get; }

    internal Export()
    {
    }

    internal Export(string id, DateTimeOffset? createdDateTime, DateTimeOffset? lastActionDateTime, Guid? reportId, string reportName, ExportState? status, int? percentComplete, string resourceLocation, string resourceFileExtension, DateTimeOffset? expirationTime)
    {
        Id = id;
        CreatedDateTime = createdDateTime;
        LastActionDateTime = lastActionDateTime;
        ReportId = reportId;
        ReportName = reportName;
        Status = status;
        PercentComplete = percentComplete;
        ResourceLocation = resourceLocation;
        ResourceFileExtension = resourceFileExtension;
        ExpirationTime = expirationTime;
    }

Anyone else noticed this, or am I missing something here? Previous versions of the SDK (4.x.x) had the error property clearly accessible. Is there another way to get error details when exports fail?

2 ACCEPTED SOLUTIONS
v-moharafi-msft
Community Support
Community Support

Hi @zaxbysdt 

Thank you for sharing the detailed comparison.

From what you've posted, it appears you're observing a discrepancy between the REST API response and the Microsoft.PowerBI.Api 5.1.0 .NET SDK.

Your Postman response clearly includes an error object when the export status is Failed:

"status": "Failed",

"error": {

    "code": "...",

    "message": "...",

    "details": []

}

However, the Export model in Microsoft.PowerBI.Api 5.1.0 does not expose an Error property, which means the SDK cannot surface these failure details through its strongly typed model.

Additionally, the current Microsoft Learn documentation for Get Export To File Status defines the Export object without an error property, even though the REST service appears to return one in failure scenarios. This suggests there is currently a mismatch between the service behavior, the SDK model, and the published documentation.

As a workaround, you could:

  • Call the REST endpoint directly and inspect the raw JSON response.
  • Deserialize the response yourself instead of relying solely on the SDK model if you need the failure details.
  • If you're using the SDK, inspect the underlying HTTP response (if available) to capture the additional JSON payload.

Based on the evidence you've provided, this looks like a potential SDK or documentation issue rather than expected behavior. 

For Reference:
Get Export To File Status (REST API)

Best Regards,
Abdul Rafi

View solution in original post

Gautam_Kumar01
Post Patron
Post Patron

Hi @zaxbysdt,

 

Good catch - I can repro this on 5.1.0. The Export model is definitely missing the Error property even though the REST API returns it.

 

**Workaround until fixed:**

You can deserialize to a custom class or use `dynamic`/`JObject` to access the error:

 

```csharp

var json = await response.Content.ReadAsStringAsync();

var exportWithError = JsonSerializer.Deserialize<ExportWithError>(json);

 

public class ExportWithError : Export 

{

    public ExportError Error { get; set; }

}

public class ExportError 

{

    public string Code { get; set; }

    public string Message { get; set; }

    public object[] Details { get; set; }

}

View solution in original post

6 REPLIES 6
v-moharafi-msft
Community Support
Community Support

Hi @zaxbysdt ,

Could you please confirm if the issue has been resolved? If not, feel free to reach out if you have any further questions.

Your update would be helpful for other members who may face a similar issue.

Best Regards,
Abdul Rafi

v-moharafi-msft
Community Support
Community Support

Hi  @zaxbysdt ,


Thank you for reaching out to Microsoft Fabric Community and thanks to @Gautam_Kumar01  for providing meaningful insights

Just wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. 

 

 Best Regards,

Abdul Rafi

Yes I have. Thank you for your response! You've confirmed my suspicions that the missing Error object is an oversight and not user error. Cheers.

Gautam_Kumar01
Post Patron
Post Patron

Hi @zaxbysdt,

 

Good catch - I can repro this on 5.1.0. The Export model is definitely missing the Error property even though the REST API returns it.

 

**Workaround until fixed:**

You can deserialize to a custom class or use `dynamic`/`JObject` to access the error:

 

```csharp

var json = await response.Content.ReadAsStringAsync();

var exportWithError = JsonSerializer.Deserialize<ExportWithError>(json);

 

public class ExportWithError : Export 

{

    public ExportError Error { get; set; }

}

public class ExportError 

{

    public string Code { get; set; }

    public string Message { get; set; }

    public object[] Details { get; set; }

}

Sensible workaround suggestion, thank you very much.

v-moharafi-msft
Community Support
Community Support

Hi @zaxbysdt 

Thank you for sharing the detailed comparison.

From what you've posted, it appears you're observing a discrepancy between the REST API response and the Microsoft.PowerBI.Api 5.1.0 .NET SDK.

Your Postman response clearly includes an error object when the export status is Failed:

"status": "Failed",

"error": {

    "code": "...",

    "message": "...",

    "details": []

}

However, the Export model in Microsoft.PowerBI.Api 5.1.0 does not expose an Error property, which means the SDK cannot surface these failure details through its strongly typed model.

Additionally, the current Microsoft Learn documentation for Get Export To File Status defines the Export object without an error property, even though the REST service appears to return one in failure scenarios. This suggests there is currently a mismatch between the service behavior, the SDK model, and the published documentation.

As a workaround, you could:

  • Call the REST endpoint directly and inspect the raw JSON response.
  • Deserialize the response yourself instead of relying solely on the SDK model if you need the failure details.
  • If you're using the SDK, inspect the underlying HTTP response (if available) to capture the additional JSON payload.

Based on the evidence you've provided, this looks like a potential SDK or documentation issue rather than expected behavior. 

For Reference:
Get Export To File Status (REST API)

Best Regards,
Abdul Rafi

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.