Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I am using below set of code to update connection string of an imported pbix file.
using System;
using System.Net.Http;
var baseAddress = new Uri("https://api.powerbi.com/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.Add("Accept", "application/json");
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + AccessToken);
using (var content = new StringContent("{ \"connectionString\": \"data source=MyAzureDB.database.windows.net;initial catalog=Sample2;persist security info=True;encrypt=True;trustservercertificate=False\"}", System.Text.Encoding.Default, "application/json"))
{
using (var response = await httpClient.PostAsync("v1.0/myorg/datasets/1c7e0f78-340c-4940-b550-622468c6a084/Default.SetAllConnections", content))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}
}
but each time status is comming as 'Waiting for activation'. Pease advice if anything is wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.