Random Musings

Sporadic thoughts on tech, economics, business, finance and trading

Create an Azure Monitor Workbook

, ,

Here’s a detailed step-by-step guide on how to create an Azure Monitor Workbook to visualize session data for an Azure Virtual Desktop (AVD) host pool:


Step 1: Access Azure Monitor Workbooks

  1. Log in to the Azure portal.
  2. In the search bar at the top, type Monitor and select Monitor.
  3. In the Monitor blade, go to the Workbooks section under Insights.

Step 2: Create a New Workbook

  1. Click + New to start creating a new workbook.
  2. A blank workbook canvas will appear.

Step 3: Add a Query to Retrieve Session Data

  1. Click Add > Query.
  2. Select the Log Analytics Workspace that is linked to your AVD diagnostics.
  3. Enter the following query to retrieve session data: WVDConnections | where TimeGenerated > ago(24h) | summarize ActiveSessions = count() by bin(TimeGenerated, 1h) | order by TimeGenerated asc
    • Explanation:
      • WVDConnections: This table logs AVD session data.
      • where TimeGenerated > ago(24h): Filters data for the last 24 hours.
      • summarize ActiveSessions: Counts active sessions, grouped by 1-hour intervals.
      • order by TimeGenerated: Ensures the data is displayed in chronological order.
  4. Click Run Query to see the results.

Step 4: Visualize the Data

  1. After running the query, click Visualization Settings in the query editor.
  2. Choose the type of visualization:
    • For trends: Select Line Chart.
    • For summary stats: Select Bar Chart or Grid.
  3. Configure the x-axis and y-axis:
    • Set the x-axis to TimeGenerated.
    • Set the y-axis to ActiveSessions.
  4. Apply and save the visualization.

Step 5: Customize the Workbook Layout

  1. Add additional components to the workbook by clicking Add and selecting from:
    • Query: To add more queries for other metrics (e.g., session failures, logins).
    • Text: To include titles, descriptions, or instructions for your workbook.
    • Metrics: To display real-time metrics like “Total Sessions.”
  2. Use Drag & Drop to arrange components in your desired layout.

Step 6: Save the Workbook

  1. Click Save at the top of the workbook editor.
  2. Enter a Name and Description for your workbook (e.g., “AVD Session Monitoring”).
  3. Choose a Category (e.g., “Shared Reports”) and click OK.

Step 7: Share the Workbook

  1. To share your workbook with others:
    • Go to the Workbooks section in Azure Monitor.
    • Select your saved workbook.
    • Click Share and configure access permissions (e.g., share with specific users or groups).
  2. Alternatively, embed the workbook in an Azure dashboard:
    • Open the workbook and click Pin to dashboard.

Step 8: Add Alerts (Optional)

You can add alerts for specific thresholds directly from your workbook:

  1. In the workbook query, define conditions (e.g., ActiveSessions > 100).
  2. Use the Alerts option in Azure Monitor to trigger notifications based on query results.

Step 9: Automate Workbook Updates

To keep your workbook updated with the latest session data:

  1. Azure Workbooks refresh automatically based on data updates in the Log Analytics Workspace.
  2. Ensure that diagnostics settings for AVD are correctly forwarding logs to the workspace.

Step 10: Additional Enhancements

  1. Add Filters:
    • Click Add Parameter to create dropdowns or filters (e.g., filter by host pool or user).
    • Use parameters to refine queries dynamically.
  2. Combine Metrics:
    • Use multiple queries in the same workbook to display related metrics (e.g., CPU/memory usage of session hosts alongside session counts).
  3. Integrate with Other Data Sources:
    • If applicable, include metrics from other Azure services like load balancers, storage, or network performance.

This method provides a centralized and customizable view of AVD session data, perfect for 24-hour capacity monitoring and planning.