Azure Monitor for VMs

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 9 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Lesson: Monitoring SAP Workloads with Azure Monitor for VMs

Introduction: Why Monitoring Matters for SAP on Azure

When you migrate SAP workloads to the cloud, the traditional "on-premises" mindset regarding infrastructure monitoring often falls short. In a data center, you might have had access to physical hardware logs, local storage performance metrics, and a dedicated network team to troubleshoot latency issues. In the Azure environment, the abstraction layer means that your SAP application, the underlying database (like HANA or SQL Server), and the virtual machine (VM) itself are all part of a shared ecosystem. Azure Monitor for VMs is the primary tool that bridges the gap between these infrastructure layers, providing deep visibility into the health and performance of your SAP instances.

Why is this so important for SAP? SAP systems are notoriously sensitive to latency, memory pressure, and input/output (I/O) throughput. A minor spike in CPU usage on a database server or a slight increase in network latency between the application server and the database can lead to degraded end-user experience, batch job failures, or even system crashes. By using Azure Monitor for VMs, you move away from reactive troubleshooting—where you only look at the system once a user complains—to proactive management, where you identify resource bottlenecks before they impact the business process.

This lesson explores how to configure, utilize, and optimize Azure Monitor for VMs specifically for the complex requirements of SAP environments. We will cover the architecture of the monitoring agent, how to set up data collection rules, how to build meaningful dashboards, and how to define alerts that actually matter to your SAP Basis team.


Not read yet

1. Understanding the Architecture of Azure Monitor for VMs

At its core, Azure Monitor for VMs relies on the Azure Monitor agent (AMA). This agent is a lightweight service that runs on your virtual machines—whether they are Windows or Linux—and collects telemetry data, which is then sent to a Log Analytics workspace. For SAP environments, this is critical because SAP requires telemetry from multiple sources: system performance counters, application logs, and specific OS-level metrics.

The architecture consists of three primary components:

  1. The Agent: The Azure Monitor Agent (AMA) installed on the VM.
  2. Data Collection Rules (DCR): A configuration set that dictates what data is collected and where it is sent.
  3. Log Analytics Workspace: The central repository where all monitoring data is stored, queried, and visualized.

Unlike older monitoring tools that required heavy local processing, the AMA is designed to be efficient. It offloads the processing of data to the Azure cloud, meaning your SAP application servers don't suffer a performance penalty just because they are being monitored. This is a vital distinction, as SAP systems are often already resource-constrained during peak processing times.

Callout: The Shift to Azure Monitor Agent (AMA) Historically, Azure used the Log Analytics agent (OMS agent) and the Dependency agent. Microsoft has now consolidated these into the Azure Monitor Agent (AMA). If you are currently using the older agents, you should plan a migration to AMA immediately. The new architecture is more stable, offers better security through Managed Identities, and allows for more granular control over data collection, which reduces costs by preventing the ingestion of unnecessary telemetry.


Not read yet

2. Setting Up Azure Monitor for VMs: Step-by-Step

To monitor your SAP environment effectively, you must ensure that your virtual machines are properly onboarded. This process involves installing the agent, assigning a system-assigned managed identity, and configuring the data collection rules.

Step 1: Enable the Azure Monitor Agent

You can enable the agent via the Azure Portal, but for large SAP landscapes, you should use Infrastructure as Code (IaC) like Bicep or Terraform. To enable it manually for a single VM:

  1. Navigate to your Virtual Machine in the Azure Portal.
  2. Select Extensions + applications under the Settings menu.
  3. Click Add and search for "AzureMonitorWindowsAgent" or "AzureMonitorLinuxAgent" depending on your OS.
  4. Follow the prompts to install the extension.

Step 2: Configure Data Collection Rules (DCR)

Data Collection Rules are the "brain" of your monitoring setup. A DCR defines what performance counters (CPU, memory, disk I/O) are collected and the frequency of that collection.

  1. Go to Monitor > Data Collection Rules.
  2. Create a new DCR and select the VMs you want to monitor.
  3. In the Resources tab, add your SAP VMs.
  4. In the Collect and deliver tab, add the performance counters. For SAP, you should prioritize:
    • Processor\% Processor Time
    • Memory\Available MBytes
    • LogicalDisk\Avg. Disk sec/Transfer
    • LogicalDisk\Disk Reads/sec and Writes/sec
  5. Save the DCR and associate it with the workspace.

Step 3: Verify Data Flow

Once the agent is installed and the DCR is active, wait approximately 5 to 10 minutes. Then, navigate to your Log Analytics Workspace and open the Logs tab. Run a simple query to verify data is flowing:

Heartbeat
| where Category == "Azure Monitor Agent"
| summarize count() by Computer, bin(TimeGenerated, 1h)

If you see results, your agent is successfully communicating with the workspace.


Not read yet

3. Monitoring SAP-Specific Metrics

While general VM metrics are useful, SAP environments require deeper insights. Azure Monitor for VMs can be extended to track SAP-specific performance indicators by utilizing the Azure Monitor for SAP solutions (a specialized monitoring stack) in conjunction with the VM metrics. However, even within the standard VM monitor, you can focus on specific patterns that indicate SAP performance issues.

Identifying Disk Latency

SAP HANA is extremely sensitive to disk latency. If your log disk latency exceeds 1ms consistently, you will notice performance degradation in SAP transactions. Use the following Kusto Query Language (KQL) snippet to check for disk latency spikes:

InsightsMetrics
| where Namespace == "LogicalDisk" and Name == "Avg. Disk sec/Transfer"
| summarize avg(Val) by Computer, bin(TimeGenerated, 5m)
| render timechart

Memory Pressure Analysis

SAP application servers (Dialog instances) often experience memory pressure during peak periods. You can monitor the "Available MBytes" to ensure you have enough headroom. If the available memory drops below a certain threshold, you might need to trigger an auto-scaling event or investigate a memory leak in a specific work process.

Warning: The Trap of Over-Monitoring A common mistake is collecting too much data. If you configure your DCR to collect every possible performance counter at a 10-second interval, you will face two problems: a massive increase in your Log Analytics ingestion costs, and "noise" that makes it impossible to find relevant alerts. Only collect the metrics that you have a specific plan to monitor or alert on.


Not read yet

4. Best Practices for SAP on Azure Monitoring

Monitoring is not a "set it and forget it" task. To maintain a performant SAP environment, you should adhere to these industry-standard practices.

Use Dedicated Log Analytics Workspaces

Do not share your SAP production workspace with development or test environments. Production data is sensitive and usually subject to different retention policies. By separating workspaces, you can manage access control (RBAC) more effectively and ensure that your production alerts don't get lost in the noise of development testing.

Implement Alerting Based on Baselines

Avoid setting generic alerts like "CPU > 80%." Instead, establish a baseline for your specific SAP workload. If your SAP system normally runs at 70% CPU during business hours, an alert at 80% is just noise. If it normally runs at 20%, then 80% is a critical issue. Use the Dynamic Thresholds feature in Azure Monitor to allow the system to learn your specific patterns and alert only when behavior deviates from the norm.

Utilize Workbooks for Visualization

Azure Monitor Workbooks allow you to create interactive reports. Instead of digging through raw logs, build a workbook that displays:

  • Current SAP Instance Status.
  • Top 5 VMs by CPU consumption.
  • Disk latency trends for HANA data and log volumes.
  • Availability percentage over the last 30 days.

Leverage Managed Identities

Always use Managed Identities for the Azure Monitor Agent. Never store credentials or API keys in your scripts or configuration files. Managed Identities provide an identity for your VM in Microsoft Entra ID (formerly Azure AD), allowing the agent to securely authenticate with your workspace without the risk of credential leakage.


Not read yet

5. Common Pitfalls and Troubleshooting

Even with a perfect setup, issues arise. Here are the most common mistakes I see when working with SAP Basis teams on Azure.

Pitfall 1: Agent Communication Failures

If you see a "Missing Data" error, the most common cause is a network security group (NSG) or firewall rule blocking the traffic to the Azure Monitor endpoints. The agent needs outbound access to specific Microsoft service tags. Ensure your NSG allows traffic to AzureMonitor and LogAnalytics service tags on port 443.

Pitfall 2: Incorrect Time Synchronization

SAP systems rely heavily on time-stamping for transaction logging and database synchronization. If the VM clock drifts, your monitoring logs will be out of sync with your SAP application logs, making root cause analysis nearly impossible. Ensure your VMs are configured to sync time with Azure's time source (NTP).

Pitfall 3: Ignoring "Heartbeat" Alerts

The Heartbeat table in Log Analytics is your best friend. If a VM stops sending a heartbeat, it doesn't necessarily mean the SAP system is down, but it means you are blind to what is happening. Always set up a "missing heartbeat" alert that triggers if a VM has not reported in for 15 minutes.

Callout: Proactive vs. Reactive Maintenance Reactive maintenance means you wait for a user to call the helpdesk. Proactive maintenance means you have a dashboard showing you that disk latency is trending upward over the last 48 hours, allowing you to move the VM to a higher-tier storage account during a planned maintenance window, rather than dealing with a system crash at 2:00 AM on a Tuesday.


Not read yet

6. Comparison: Azure Monitor for VMs vs. External Tools

Many organizations ask if they still need third-party monitoring tools (like Dynatrace or AppDynamics) if they use Azure Monitor. The following table highlights the differences.

Feature Azure Monitor for VMs Third-Party APM Tools
Infrastructure Visibility Native and deep Varies
SAP Application Logic Limited (Basic) High (Deep code tracing)
Cost Integrated (Pay-as-you-go) Often high licensing fees
Configuration Native Azure integration Requires separate agents
Best For Infrastructure health, OS metrics Application performance, code-level debugging

For most SAP on Azure deployments, Azure Monitor provides the necessary infrastructure visibility. You should only look into third-party tools if you have a specific requirement for deep application-level transaction tracing that standard SAP transactions cannot provide.


7. Advanced: Automating Remediation

One of the most powerful features of Azure Monitor is the ability to trigger automated responses. For example, if your SAP application server experiences a critical memory leak, you can trigger an Azure Function to restart the service or scale the VM size.

Example: Triggering an Action Group

  1. Create an Action Group: In the Azure Portal, go to Monitor > Alerts > Manage actions.
  2. Define the Action: Select "Azure Function" or "Logic App" as the action type.
  3. Link to Alert: When you create an alert rule for high memory, link it to this Action Group.

This allows you to move from "monitoring" to "self-healing." While you should be cautious about automating actions on production SAP databases, automating restarts for web dispatchers or dialog instances can significantly reduce downtime and the burden on your support team.


Not read yet

8. Summary and Key Takeaways

Monitoring SAP workloads on Azure is not just about keeping the lights on; it is about ensuring that the business processes running on SAP remain performant and reliable. By using Azure Monitor for VMs, you gain the visibility required to manage these complex systems effectively.

Key Takeaways for your SAP Operations:

  • Standardize on AMA: Transition all your SAP VMs to the Azure Monitor Agent (AMA) to benefit from the latest improvements in security and efficiency.
  • Targeted Data Collection: Use Data Collection Rules (DCR) to collect only the metrics that matter to you. This keeps your costs predictable and your data clean.
  • Prioritize Disk Latency: For SAP HANA, disk latency is the most critical metric. Monitor this closely to prevent performance bottlenecks.
  • Use Dynamic Thresholds: Avoid alert fatigue by using Azure Monitor’s built-in intelligence to define alerts based on historical patterns rather than static, hard-coded numbers.
  • Secure with Managed Identities: Never store credentials on your VMs. Always use Managed Identities for all monitoring-related communication.
  • Centralize with Workbooks: Don't rely on raw logs. Use Workbooks to visualize the health of your entire SAP landscape in one place, making it easier to identify trends and anomalies.
  • Test your Alerts: A monitoring system is only as good as its alerts. Regularly test your alerting pipelines to ensure that when a real issue occurs, the right people are notified immediately.

By following these practices, you will ensure that your SAP environment on Azure is not only stable but also transparent and easy to troubleshoot. Always remember that the goal of monitoring is to provide the information necessary to make informed decisions before a minor issue becomes a business-critical outage.


Not read yet

Common Questions (FAQ)

Q: Does Azure Monitor for VMs monitor the SAP application layer? A: Azure Monitor for VMs focuses on the infrastructure (VM, disk, network). To monitor the SAP application layer (e.g., work processes, update tasks, print queues), you should look into the "Azure Monitor for SAP solutions" offering, which integrates with the SAP Control Center.

Q: How much does monitoring with Azure Monitor cost? A: Costs are based on the volume of data ingested into your Log Analytics workspace and the retention period. By using DCRs to filter out unnecessary performance counters, you can significantly control these costs.

Q: Can I monitor SAP systems running on-premises using Azure Monitor? A: Yes, by installing the Azure Monitor Agent on your on-premises servers and connecting them to an Azure Log Analytics workspace via the Azure Arc-enabled server framework.

Q: What is the recommended retention period for SAP monitoring data? A: For most production environments, a retention period of 30 to 90 days is sufficient for troubleshooting recent issues. If you need data for long-term compliance or auditing, you can move older data to an Azure Storage account (Archive tier) to save costs.

Q: How do I know if the agent is working correctly? A: You can check the "Agent Health" solution in your Log Analytics workspace, or use the Heartbeat KQL query mentioned earlier in this lesson to ensure all your registered VMs are reporting back to the workspace.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.