Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Send delete rows from webapp

Hello, I am using webapp which runs a c# apllication and sends real-time data and stream analytics and stream anaytics send processed data to powerbi app. Is there any way to send deleterows commen...
  • v-qiuyu-msft's avatar
    8 years ago

    Hi Anonymous,

     

    With a streaming dataset (assume you create a streaming dataset via API option in above image), there is no underlying database, so you cannot make use of any report functionality such as filtering, custom visuals, and other report functions. It’s a temporary cache which will expires quickly (in one hour) so you can not perform any delete operation on it. The temporary cache is only used to display visuals which have some transient sense of history. You can not access cache.

     

    If you enable Historic data analysis, it becomes a pushstreaming dataset, and we can 

    delete rows from “PushStreaming” datasets using REST API. But it requires Azure Active Directory authentication. 

     

     

      string uri = @"https://api.powerbi.com/v1.0/myorg/datasets/{dataset id}/tables/RealTimeData/Rows";

                HttpWebRequest request = System.Net.WebRequest.Create(uri) as System.Net.HttpWebRequest;

                request.KeepAlive = true;

                request.Method = "DELETE";

                request.ContentLength = 0;

                request.ContentType = "application/json";

                request.Headers.Add("Authorization", String.Format("Bearer {0}", token));

                //Get HttpWebResponse from GET request 

                using (HttpWebResponse httpResponse = request.GetResponse() as System.Net.HttpWebResponse)

                {

                    //Get StreamReader that holds the response stream 

                    using (StreamReader reader = new System.IO.StreamReader(httpResponse.GetResponseStream()))

                    {

                        string responseContent = reader.ReadToEnd();

                    }

                }

     

    If you are creating a pushstreaming dataset and you don't have Azure AD, it's not possible to delete rows from the dataset. 

     

    Best Regards,
    Qiuyun Yu