Unable to apply background color thresholds using a Stat in Azure Dashboard (Log Analytics query)

Jan Adam Halama 0 Reputation points
2024-12-16T09:14:47.1866667+00:00

Issue Description: I am trying to apply background color thresholds based on the FinalStatusCode column in Azure Dashboards when visualizing results from a Log Analytics query. However, I am encountering an error when configuring the "Color settings" using the Thresholds option. Applying icons to the same column works perfectly fine, but setting a background color fails and throws the following error:

"Uncaught TypeError: Cannot read properties of undefined (reading 'FinalStatusCode')"

This error seems to occur within the Azure portal UI when attempting to validate or render the background color settings.

Steps to Reproduce:

  1. Run a simplified mock query in Log Analytics:
       print Summary="2 Errors", FinalStatusCode=2
    
    1. Configure the visualization as follows:
      • Visualization Type: Stat
        • Apply thresholds in Color settings:
           - Source: `FinalStatusCode`
          
                 - Operator: `==`
          
                       - Value: `2`
          
                             - Color: **Red**
          
                             1. Error occurs when attempting to apply the background color.
          

Additional Observations:

  • Using Icon settings with the same conditions (e.g., FinalStatusCode == 2) works without any issue.

Environment:

  • Service: Azure Monitor > Dashboards > Logs (Log Analytics)
  • Resource Type: Log Analytics

Questions:

  1. Is this a known issue or limitation in Azure Dashboards?
  2. Are there any workarounds to apply background color thresholds for FinalStatusCode?
  3. Could this issue be related to a misconfiguration, or is it likely a bug within the Azure portal?
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,449 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pranay Reddy Madireddy 1,600 Reputation points Microsoft Vendor
    2024-12-17T00:03:19.1066667+00:00

    Hi Jan Adam Halama

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Check that your query is returning the FinalStatusCode column correctly and that the values are valid. You can do this by running the query and confirming that FinalStatusCode shows up in the results.

    print Summary="2 Errors", FinalStatusCode=2

    Make sure your query is showing the correct FinalStatusCode results. You can also use the project operator to select FinalStatusCode directly in your query.

    print Summary="2 Errors", FinalStatusCode=2

    | project FinalStatusCode

    you have any further queries, do let us know.


    If the answer is helpful, please click "Upvote it".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.