Workbooks and Custom Dashboards

Watch the video to deepen your understanding.
SubscribeComplete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
Workbooks and Custom Dashboards
Introduction: Gaining Insight from Your Monitoring Data
In the complex landscape of modern IT infrastructure, simply collecting logs and metrics is not enough. The true value of monitoring data lies in its ability to provide actionable insights, enable rapid troubleshooting, and inform strategic decisions. Without effective visualization and organization of this data, even the most robust logging solution can become an overwhelming data swamp.
This is where Workbooks and Custom Dashboards come in. These powerful tools transform raw monitoring data into meaningful, interactive, and shareable views. They are essential components of any comprehensive logging and monitoring strategy, allowing you to:
- Visualize Key Metrics and Logs: Create intuitive charts, graphs, and grids from diverse data sources.
- Accelerate Troubleshooting: Quickly identify performance bottlenecks, errors, and security threats.
- Enhance Operational Awareness: Provide real-time status updates and health overviews for critical systems.
- Facilitate Collaboration: Share insights with team members, stakeholders, and management.
- Support Root Cause Analysis: Interactively drill down into data to understand the underlying issues.
While both serve to visualize data, Workbooks excel at flexible, interactive analysis and reporting, often used for deep dives and troubleshooting. Custom Dashboards, on the other hand, are ideal for high-level overviews and quick access to critical information. Understanding when and how to leverage each is key to designing an effective monitoring solution.
Detailed Explanation with Practical Examples
Azure Workbooks: Interactive Data Exploration and Reporting
Azure Workbooks provide a flexible canvas for data analysis and the creation of rich visual reports within Azure Monitor. They can combine text, analytics queries (KQL), metrics, and parameters into interactive documents. Workbooks are incredibly versatile, making them suitable for:
- Troubleshooting Guides: Step-by-step diagnostic workflows.
- Root Cause Analysis: Interactive exploration of logs and metrics to identify issues.
- Operational Reports: Summaries of performance, health, and usage.
- Security Investigations: Correlating security events across different sources.
Key Features of Workbooks:
- Diverse Data Sources: Query data from Azure Monitor Logs (Log Analytics, Application Insights), Azure Monitor Metrics, Azure Resource Graph, Azure Data Explorer, and more.
- Rich Visualizations: Display data as grids, area charts, bar charts, line charts, scatter charts, pie charts, time series, and even custom visualizations.
- Interactive Parameters: Allow users to filter data dynamically (e.g., by time range, resource group, instance name) without editing the underlying queries.
- Text and Markdown Support: Add context, explanations, and instructions directly within the workbook.
- Templates: Create and share reusable workbook templates.
Practical Example: Monitoring VM Performance with a Workbook
Let's imagine we want to create a workbook to monitor the CPU utilization and available memory for a set of Azure Virtual Machines.
Navigate to Workbooks: In the Azure portal, search for "Monitor," then select "Workbooks" under the "Insights" section.
Create a New Workbook: Click "New" to start from scratch or choose a template.
Add a Text Section: Start with a title and description using Markdown.
# Virtual Machine Performance Overview This workbook provides an interactive view of key performance metrics for your Azure Virtual Machines.Add a Time Range Parameter: This allows users to select the data window.
- Click "Add parameters."
- Choose "Time range parameter."
- Give it a name (e.g.,
TimeRange). - Set default value (e.g., "Last 4 hours").
Add a Resource Parameter (Optional but Recommended): To filter by specific VMs.
- Click "Add parameters."
- Choose "Resource picker parameter."
- Give it a name (e.g.,
VMs). - Set "Resource types" to "Virtual machines."
- Set "Allow multiple selections" to "True."
Add a Query Section for CPU Utilization:
- Click "Add query."
- Select "Log Analytics" as the Data source and choose your Log Analytics workspace.
- Enter the following Kusto Query Language (KQL) query:
Perf | where ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total" | where TimeGenerated between {TimeRange} // Use the time range parameter | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 5m) | render timechart title="Average CPU Utilization (%)"- Configure the visualization type (e.g., "Time chart").
- You can further refine this to use the
VMsparameter by addingand Computer in ({VMs})if you added the resource parameter.
Add a Query Section for Available Memory:
- Click "Add query."
- Use a similar KQL query:
Perf | where ObjectName == "Memory" and CounterName == "Available MBytes" | where TimeGenerated between {TimeRange} | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 5m) | render timechart title="Average Available Memory (MB)"- Again, you can filter by
VMsif desired.
Save the Workbook: Give it a meaningful name and save it to a resource group.
Now, users can interact with this workbook, changing the time range or selecting specific VMs to dynamically update the charts.
Azure Custom Dashboards: High-Level Overviews and Quick Access
Azure Dashboards provide a consolidated, personalized view of your cloud resources and monitoring data. Unlike Workbooks, which are designed for deep analytical dives, dashboards are best suited for:
- Executive Summaries: Quick health checks of critical services.
- Team-Specific Monitoring: A central place for a particular team to monitor their resources.
- Operational Overviews: Displaying key performance indicators (KPIs) and alerts at a glance.
- Quick Access: Providing shortcuts to frequently used resources, documentation, or Workbooks.
Key Features of Dashboards:
- Customizable Tiles: Add various types of tiles, including metric charts, log query results, resource health, resource groups, alerts, Markdown, and even external web content.
- Shareable: Dashboards can be private or shared with other users or groups within your organization.
- Flexible Layout: Drag and drop tiles to arrange them as needed.
- Programmatic Deployment: Dashboards can be defined and deployed using Azure Resource Manager (ARM) templates, allowing for version control and consistent deployment across environments.
Practical Example: Creating a High-Level Operations Dashboard
Let's create a dashboard that shows the health of our critical applications and infrastructure.
- Navigate to Dashboards: In the Azure portal, click "Dashboard" on the left navigation pane or search for it.
- Create a New Dashboard: Click "+ New dashboard."
- Add Tiles: From the "Tile Gallery" on the left, drag and drop desired tiles onto the canvas.
- Metric Chart: Drag a "Metric chart" tile. Configure it to show the average CPU utilization for a specific VM or a set of VMs.
- Resource: Select your VM(s).
- Metric Namespace:
Azure Monitor - Metric:
Percentage CPU - Aggregation:
Avg
- Log Analytics (Query): Drag a "Log Analytics" tile. Configure it to show the count of critical errors from Application Insights.
exceptions | where severityLevel == "2" // Critical errors | summarize count() by bin(timestamp, 1h) | render barchart title="Critical Application Exceptions (Last 24h)" - Resource Health: Drag a "Resource health" tile. Select your critical application gateways or databases to show their current health status.
- Alerts: Drag an "Alerts (preview)" tile to display active alerts.
- Markdown: Drag a "Markdown" tile to add custom text, links to documentation, or links to your Workbooks.
(Replace placeholders like# Operations Overview Quick links: * [VM Performance Workbook](#resource/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Portal/dashboards/{workbookName}) * [Application Insights Dashboard](https://portal.azure.com/#blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/resourceId/%2Fsubscriptions%2F{subscriptionId}%2Fresourcegroups%2F{resourceGroup}%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2F{appInsightName}/source/LogsBlade){subscriptionId}with actual values).
- Metric Chart: Drag a "Metric chart" tile. Configure it to show the average CPU utilization for a specific VM or a set of VMs.
- Arrange and Resize Tiles: Organize the tiles for optimal readability.
- Save the Dashboard: Give it a descriptive name. Choose whether to share it or keep it private.
Integrating Dashboards and Workbooks
Dashboards and Workbooks are complementary. A common pattern is to use a dashboard for a high-level overview, with tiles that link directly to more detailed Workbooks for deeper analysis. For example, an "Application Health" dashboard tile could link to an "Application Troubleshooting" workbook.
Code Snippet: Deploying an Azure Dashboard via ARM Template
While Workbooks are often created interactively, both Workbooks and Dashboards can be deployed programmatically using Azure Resource Manager (ARM) templates. This is crucial for Infrastructure as Code (IaC) practices, ensuring consistency and version control.
Here's a simplified ARM template snippet for deploying an Azure Dashboard:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dashboardName": {
"type": "string",
"defaultValue": "MyOperationalDashboard",
"metadata": {
"description": "Name of the Azure Dashboard."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for the dashboard."
}
}
},
"resources": [
{
"type": "Microsoft.Portal/dashboards",
"apiVersion": "2019-01-01-preview",
"name": "[parameters('dashboardName')]",
"location": "[parameters('location')]",
"properties": {
"lenses": [
{
"order": 0,
"parts": [
{
"position": {
"x": 0,
"y": 0,
"rowSpan": 4,
"colSpan": 6
},
"metadata": {
"type": "Extension/Microsoft_Azure_Monitoring/PartType/MetricChartPart",
"settings": {
"content": {
"resourceIds": [
"/subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/YOUR_RESOURCE_GROUP/providers/Microsoft.Compute/virtualMachines/YOUR_VM_NAME"
],
"metrics": [
{
"resourceId": "/subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/YOUR_RESOURCE_GROUP/providers/Microsoft.Compute/virtualMachines/YOUR_VM_NAME",
"name": "Percentage CPU",
"namespace": "Microsoft.Compute/virtualMachines",
"aggregationType": 0,
"seriesParameters": [],
"criteria": {
"metricName": "Percentage CPU",
"name": "Percentage CPU",
"dimensions": []
}
}
],
"timeContext": {
"durationMs": 14400000, // Last 4 hours
"grain": 300000, // 5 minutes
"timeGrain": "PT5M",
"timeRange": "PT4H"
},
"chartType": 0, // 0 for line chart
"title": "VM CPU Utilization",
"xAxes": [
{
"label": "Time"
}
],
"yAxes": [
{
"label": "CPU (%)"
}
]
}
}
}
}
]
}
],
"metadata": {
"model": {
"timeRange": {
"value": {
"relative": {
"duration": 24,
"timeUnit": 1
}
},
"type": 4
}
}
}
}
}
]
}
Note: Replace YOUR_SUBSCRIPTION_ID, YOUR_RESOURCE_GROUP, and YOUR_VM_NAME with your actual Azure resource details.
This template creates a dashboard with a single tile displaying the CPU utilization of a specified VM. More complex dashboards would involve more parts within the lenses array.
Best Practices and Common Pitfalls
Best Practices
- Define Your Audience and Purpose: Before creating, understand who will use it and what questions it needs to answer.
- Workbooks: Often for engineers, SREs, developers for deep analysis.
- Dashboards: For operations teams, managers, executives for quick status.
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons