Search code examples
azureparametersazure-dashboard

How to make Log Analytics pinned parts to work with Azure Dashboard filters (parameters)?


I've found a Microsoft info like this: https://techcommunity.microsoft.com/t5/azure-observability-blog/log-analytics-pinned-parts-now-works-with-azure-dashboard/ba-p/2193071

But there is no technical information at all of how to configure that to have the possibility to filter pinned charts based on Log Analytic Workspace by using Azure Dashboard top filters (parameters). Does anyone know how to do that or have some Microsoft documentation link ?

Thanks in advance.

I try to achieve this: https://techcommunity.microsoft.com/t5/azure-observability-blog/log-analytics-pinned-parts-now-works-with-azure-dashboard/ba-p/2193071


Solution

  • I've finally found out what the problem with linking the filters from KQL query to the Azure Dashboard is. Looks like a BUG of a FEATURE in Microsoft Azure Workbooks.

    Description:

    I've created a sample KQL script (Log Analytics Workspace (LAW) with the SigninLogs table from Entra ID -> Diagnostic Settings already created and is there)

    SigninLogs
    | where Identity contains "John" or Identity contains "Sam"
    | summarize Count=count() by Identity
    

    Then I ran this KQL script directly from the Log Analytics Workspace -> Logs -> Query:

    Log Analytics Workspace - query

    And from there I've Pin it to the Azure Dashboard.

    Then when I go to Azure Dashboard and the filter "Identity" (specified in the "where" clause of the KQL script) was not visible in "Add Filter" itself.

    But when I "Edit" the Dashboard and next add - as RithwikBojja mentioned above - just a sample "Metrics" tile, Save the dashboard and next click on "Add filter" the "Identity" filter magically shown up there.

    Azure Dashboard - sample metric tile added

    Now I was able to filter the data on the "Azure Dashboard" element directly now.

    Azure Dashboard = Filter selection

    BUG/FEATURE Description: The problem is that when I created "Azure Workbook" first - according to the Microsoft manuals - and then created KQL query in Azure Workbook (the same script) and pin the Query Result to the same Azure Dashboard and add a sample Metrics tile as earlier it doesn't work at all.

    The SOLUTION to be able to see and filter results in Azure Dashboards is not to use Azure Workbooks but to use "Azure Portal -> Log Analytics Workspace (LAW) -> Logs -> Query", specify the KQL query there, then pin it to Azure Dashboard you need, then "Edit" the Azure Dashboard, add a sample tile like "Metrics", "Save" the Azure Dashboard and then in the "Add filter" our filters specified in the "where" clause of the KQL scripts will be there for selection. Azure Workbooks do not work at all for that purpose. Microsoft could fix that.