Forum Discussion
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?
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 RafiHi 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; }
}
6 Replies
- v-moharafi-msftCommunity 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-msftCommunity 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
- zaxbysdtRegular Visitor
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_Kumar01Post Partisan
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; }
}
- zaxbysdtRegular Visitor
Sensible workaround suggestion, thank you very much.
- v-moharafi-msftCommunity 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