The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi Team,
We have a WPF app using Microsoft.PowerBI.Api, which is dependent on Microsoft.Rest.ClientRuntime package, "This package has been deprecated as it is legacy and is no longer maintained." Suggested alternate for Microsoft.Rest.ClientRuntime is Azure.Core 1.34.0. However Microsoft.PowerBI.APi is depending on Microsoft.Rest.ClientRuntime packgae.
Can someone provide the best approach to fix this?
Thanks,
Raghav
Solved! Go to Solution.
HI @RaghavJev,
As the document said the 'Microsoft.Rest.ClientRuntime' package will continue to receive critical bug fixes until September 2023 and you can continuous use these functions until September.
For migrate from 'Microsoft.Rest.ClientRuntime' to 'Azure.core', you can use the Azure.Core.Pipeline.HttpPipeline class instead of Microsoft.Rest.ServiceClient and use the Azure.Core.TokenCredential class instead Microsoft.Rest.ServiceClientCredentials.
For example:
using Azure.Core;
using Azure.Identity;
using Azure.Security.KeyVault.Secrets;
using Microsoft.PowerBI.Api;
using Microsoft.PowerBI.Api.Models;
using System;
// Create a new instance of TokenCredential using DefaultAzureCredential
TokenCredential credential = new DefaultAzureCredential();
// Authenticate with Power BI using TokenCredential
var client = new PowerBIClient(new Uri("https://api.powerbi.com"), credential);
The above code uses DefaultAzureCredential to authenticate with Power BI using Azure Active Directory . You can also use other types of credentials, such as ClientSecretCredential, depending on your authentication requirements .
// create a client
var client = new SecretClient(new Uri("http://example.com"), new DefaultAzureCredential());
Regards,
Xiaoxin Sheng
HI @RaghavJev,
As the document said the 'Microsoft.Rest.ClientRuntime' package will continue to receive critical bug fixes until September 2023 and you can continuous use these functions until September.
For migrate from 'Microsoft.Rest.ClientRuntime' to 'Azure.core', you can use the Azure.Core.Pipeline.HttpPipeline class instead of Microsoft.Rest.ServiceClient and use the Azure.Core.TokenCredential class instead Microsoft.Rest.ServiceClientCredentials.
For example:
using Azure.Core;
using Azure.Identity;
using Azure.Security.KeyVault.Secrets;
using Microsoft.PowerBI.Api;
using Microsoft.PowerBI.Api.Models;
using System;
// Create a new instance of TokenCredential using DefaultAzureCredential
TokenCredential credential = new DefaultAzureCredential();
// Authenticate with Power BI using TokenCredential
var client = new PowerBIClient(new Uri("https://api.powerbi.com"), credential);
The above code uses DefaultAzureCredential to authenticate with Power BI using Azure Active Directory . You can also use other types of credentials, such as ClientSecretCredential, depending on your authentication requirements .
// create a client
var client = new SecretClient(new Uri("http://example.com"), new DefaultAzureCredential());
Regards,
Xiaoxin Sheng
User | Count |
---|---|
6 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
6 | |
5 | |
4 |