Skip to content

Fix casing of IsRefreshable in Dataset.Serialization.cs#219

Closed
Arjan321 wants to merge 1 commit intomicrosoft:masterfrom
Arjan321:master
Closed

Fix casing of IsRefreshable in Dataset.Serialization.cs#219
Arjan321 wants to merge 1 commit intomicrosoft:masterfrom
Arjan321:master

Conversation

@Arjan321
Copy link
Copy Markdown

Description

A regression occurred in the v5 release of the PowerBI SDK. The casing of various properties in DataSet are wrong.

v4:

#:property PublishAot=false

#:package Microsoft.Identity.Client@4.79.2
#:package Microsoft.PowerBI.Api@4.22.0

using Microsoft.Identity.Client;
using Microsoft.PowerBI.Api;
using Microsoft.Rest;

var clientId = Environment.GetEnvironmentVariable("POWERBI_CLIENT_ID") ?? throw new InvalidOperationException("POWERBI_CLIENT_ID environment variable is not set.");
var clientSecret = Environment.GetEnvironmentVariable("POWERBI_CLIENT_SECRET") ?? throw new InvalidOperationException("POWERBI_CLIENT_SECRET environment variable is not set.");
var tenant = Environment.GetEnvironmentVariable("POWERBI_CLIENT_TENANT") ?? throw new InvalidOperationException("POWERBI_CLIENT_TENANT environment variable is not set.");
Guid workspaceId = Environment.GetEnvironmentVariable("POWERBI_WORKSPACE_ID") is string workspaceIdString && Guid.TryParse(workspaceIdString, out var wsId) ? wsId : throw new InvalidOperationException("POWERBI_WORKSPACE_ID environment variable is not set or is not a valid GUID.");

var authenticationResult = await ConfidentialClientApplicationBuilder
    .Create(clientId)
    .WithClientSecret(clientSecret)
    .WithAuthority($"https://login.microsoftonline.com/{tenant}")
    .Build()
    .AcquireTokenForClient(["https://analysis.windows.net/powerbi/api/.default"]).ExecuteAsync();

var powerBiClient = new PowerBIClient(new Uri("https://api.powerbi.com"), new TokenCredentials(authenticationResult.AccessToken, authenticationResult.TokenType));

var dataSets = (await powerBiClient.Datasets.GetDatasetsInGroupAsync(workspaceId)).Value.ToDictionary(x => x.Id);

foreach (var dataset in dataSets.Values)
{
    Console.WriteLine($"id: {dataset.Id} - IsEffectiveIdentityRequired: {dataset.IsEffectiveIdentityRequired} - IsRefreshable: {dataset.IsRefreshable}");
}

Output: id: <guid> - IsEffectiveIdentityRequired: False - IsRefreshable: True

v5:

#:property PublishAot=false
#:package Azure.Identity@1.17.1
#:package Microsoft.PowerBI.Api@5.0.0

using System.Diagnostics;
using Azure.Identity;
using Microsoft.PowerBI.Api;

Console.WriteLine("Power BI SDK 5.x example");

var clientId = Environment.GetEnvironmentVariable("POWERBI_CLIENT_ID") ?? throw new InvalidOperationException("POWERBI_CLIENT_ID environment variable is not set.");
var clientSecret = Environment.GetEnvironmentVariable("POWERBI_CLIENT_SECRET") ?? throw new InvalidOperationException("POWERBI_CLIENT_SECRET environment variable is not set.");
var tenant = Environment.GetEnvironmentVariable("POWERBI_CLIENT_TENANT") ?? throw new InvalidOperationException("POWERBI_CLIENT_TENANT environment variable is not set.");
Guid workspaceId = Environment.GetEnvironmentVariable("POWERBI_WORKSPACE_ID") is string workspaceIdString && Guid.TryParse(workspaceIdString, out var wsId) ? wsId : throw new InvalidOperationException("POWERBI_WORKSPACE_ID environment variable is not set or is not a valid GUID.");

PowerBIClient client = new(new ClientSecretCredential(tenant, clientId, clientSecret));

var dataSets = (await client.Datasets.GetDatasetsInGroupAsync(workspaceId)).Value.Value.ToDictionary(x => x.Id);
foreach (var dataset in dataSets.Values)
{
    Console.WriteLine($"id: {dataset.Id} - IsEffectiveIdentityRequired: {dataset.IsEffectiveIdentityRequired} - IsRefreshable: {dataset.IsRefreshable}");
}

Output: id: <guid> - IsEffectiveIdentityRequired: - IsRefreshable:

As you can see, the properties are lost.

Question

please answer the following questions. put x inside [ ] (e.g. [x])

What inside?

  • Bug Fixes?
  • New Features?
  • Documentation?

Is pull request totally generated from swagger file?

  • Yes.
  • No, part of it is auto-generated.

Backward compatibility break?

  • Yes. Pull request breaks backward compatibility!

Learn more about backward compatibility.

@jimp100
Copy link
Copy Markdown

jimp100 commented Jan 30, 2026

A vote for getting this merged and released asap!

@Arjan321
Copy link
Copy Markdown
Author

Arjan321 commented Feb 3, 2026

@KupoCat can you look at this please?

@Arjan321
Copy link
Copy Markdown
Author

@ayeshurun can you look at this please?

@a-teece
Copy link
Copy Markdown

a-teece commented Mar 4, 2026

@KupoCat @ayeshurun I found the same issue back in November 2025 and tried to email people at Microsoft (got the email addresses from the git commits) but heard no reply.

The issue was introduced with the commit that switched to AutoRest V3 (3a88dcb)

I believe the issue affects many more objects and properties than just Dataset. It would be great if this repo accepted issues so the problems can be reasonably logged.

@Arjan321
Copy link
Copy Markdown
Author

This is now support request 2603131420000271. Let's see if that gets attention here

@Arjan321
Copy link
Copy Markdown
Author

Arjan321 commented Mar 16, 2026

This is now support request 2603131420000271. Let's see if that gets attention here

And PowerBI SDK 5.1 has been released 2 hours ago, with this fix. Coincidence?

…uired, isOnPremGatewayRequired, encryption, isRefreshable and isInPlaceSharingEnabled in swagger.json and regenerate the models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants