Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.