Forum Discussion

Patrick Naughton's avatar
Patrick Naughton
Brass Contributor
Sep 26, 2018

PowerBI calls Log Analytics via query string, fails on large queries.

It seems that PowerBI only talks to Log Analytics via an url encoded query string.

 

https://api.loganalytics.io/v1/workspaces/workspaceid/query?query=your url encoded query here...

 

If your query is large, this will get cut off after 2KB... and fail.

 

Is there any way to make PowerBI POST the query rather than putting it on the URL?

4 Replies

  • Jason Dempsey's avatar
    Jason Dempsey
    Copper Contributor

    If you are talking about the length of the query string, URIs are often limited to around 2k as I recall.

    https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers

     

    Were you looking for how to make PowerBI do this through POST or how to POST to AzureLogAnalytics? As I recall, both are possible:
    PowerBI Post:
    https://blog.crossjoin.co.uk/2014/04/19/web-services-and-post-requests-in-power-query/

    Azure Log Analytics:
    https://dev.loganalytics.io/

    • Patrick Naughton's avatar
      Patrick Naughton
      Brass Contributor

      I know urls are 2k, that was why i posted.

       

      also, post does not work with authenticated queries.

       

      https://social.technet.microsoft.com/Forums/en-US/6366dd5d-302c-42fb-8283-c833954c3858/sending-contents-to-windows-authenticated-service-results-in-an-error-quotcontent-option-is-only?forum=powerquery

       

       

      • Jason Dempsey's avatar
        Jason Dempsey
        Copper Contributor

        That sounds like a better question for the PowerBI forums, as PowerBI can do POST (but apparently not authenticated POST), and Azure Log Analytics uses authenticated POST.

         

        After a cursory look at PowerBI's data sources, it looks like Azure Log Analytics isn't currently a supported data source for Power BI. You could probably get around this by either writing a PowerShell script and storing the responses locally, or you could write a Power BI custom connector.