☁️
CTHFM: Azure
  • Welcome
  • Getting Started
    • Account Setup
      • Account Creation Instructions
  • Azure Fundamentals
    • Azure Fundamentals Overview
      • Azure Documentation
      • Azure Entra
      • Azure Hierarchy
      • Identities
      • Azure Entra Roles
      • Azure RBAC
      • Azure Licensing Overview
        • Azure Entra ID Premium Licenses Comparison
      • Azure Shared Responsibility Model
      • Azure Frameworks
      • Azure Security Services
      • Conditional Access Policies
        • How Conditional Access Policies Work
        • Benefits of Conditional Access
        • Best Practices for Conditional Access
        • Conditions for Conditional Access
        • Conditional Access Controls
        • Sign-In Risk and Identity Protection
        • Conditional Access Session Control
        • Name Locations IP Location
      • Azure Quotas
      • Azure Tokens
        • Access Tokens
        • ID Tokens
        • Refresh Tokens
          • Invalidate Refresh Tokens
        • Primary Refresh Tokens
        • Continuous Access Evaluation (CAE)
        • Token Protection: Conditional Access (Public Preview)
  • Azure CLI
    • Introduction to Azure CLI
    • Installing Azure CLI
    • CLI Commands
    • Resource Group Management
    • Creating and Managing Resources with Azure CLI
    • Managing IAM
    • Azure CLI Automation
    • Monitoring and Troubleshooting in Azure CLI
    • Azure CLI Overview
      • Azure CLI: Linux
      • Azure CLI: Windows
      • Azure CLI: MacOS
  • KQL
    • KQL Overview
      • KQL Introduction
      • Data Types
      • Quick Reference
      • Render
      • Basic Queries
  • Powershell
    • PowerShell for Azure
      • Powershell Documentation
      • Powershell Basics
      • Understanding Powershell Variables
      • Understanding Cmdlets
      • Powershell Console & ISE
      • Powershell: Entra Module
        • Module Reference & Getting Started
      • Powershell: Azure Module
        • Installation Instructions
        • Powershell Azure CLI: Windows
        • Powershell Azure CLI: Linux
        • Powershell Azure CLI: MacOS
        • Example Azure Cmdlets
  • Bicep
    • Bicep File Structure
    • Variable Types
  • Azure Logging References
    • Logging
      • Log Retention Strategies
      • Azure Log Types
      • Azure Activity Logs
        • Administrative Event Schema
        • Service Health Notification Schema
        • Resource Health
        • Alert Category
        • Autoscale
        • Security
        • Recommendation
        • Policy
      • Entra ID Logging
        • Identity Based Logs
          • Audit Logs
          • Sign-In Logs
            • AADNonInteractiveUserSignInLogs
            • AADManagedIdentitySignInLogs
            • AADServicePrincipalSignInLogs
            • First Party Sign-In Activity
          • Provisioning Logs (AADProvisioningLogs)
          • Microsoft Graph Activity
          • Identity Protection
            • Risk Detections
            • AADRiskyServicePrincipals
            • AADRiskyUsers
            • AADUserRiskEvents
            • AADServicePrincipalRiskEvents
        • Additional Entra ID Logs
      • Azure Key Vault
        • Azure Key Vault Logging Overview
      • Network Watcher
        • RBAC Permissions
        • Flow Log Types
          • NSG Flow Log Schema
          • VNET Flow Log Schema
        • Enabling Logs
          • NSG Flow Logs
          • VNET Flow Logs
        • Packet Capture
          • Packet Capture: VM
          • Packet Capture: Scale Sets
      • Compute Resources
        • Azure Monitor Agent
        • VM Insights
          • VM Insights Tables
      • Storage Accounts
        • Storage Account Logging
          • File
            • Enable StorageFileLogs
            • StorageFileLogs
          • Blob
            • Enable Blob Logging
            • StorageBlobLogs
          • Queue
            • Enable Queue Logging
            • StorageQueueLogs Table
          • Table
            • Enable Table Logging
            • StorageTableLogs Table
      • Azure App Service
        • Log Types
        • Enabling Logging
      • Azure Monitor
        • Resource Logs
          • Resource Log Top Level Documentation
        • Log Analytics Workspace
          • Setup
        • Workbooks
        • Dashboards
        • Alerts
        • Azure Monitor Documentation
      • Defender for Cloud
      • Intune
      • Sysmon
      • Purview Audit Log Schema
      • Kubernetes Audit Log (AKS)
  • Threat Hunting
    • Threat Hunting in Azure
      • Threat Hunting Introduction
      • Threat Hunting Process
        • Hypothesis Generation
        • Investigation
        • Identification
        • Resolution & Follow Up
      • Pyramid of Pain
      • Azure Threat Hunting Ideas
      • Hands On Threat Hunting Examples
      • OSINT Feeds
  • Sigma
    • Sigma Rule Structure
  • Microsoft Defender TI
    • Microsoft Defender Threat Intelligence
      • Data Sets
      • Reputational Scoring
      • Analyst Insights
      • Microsoft Defender TI: Copilot Integration
  • MITRE Att&ck
    • MITRE Att&ck
      • MITRE Att&ck Concepts
      • MITRE Data Sources
      • MITRE Att&ck Mitigations
      • MITRE Att&ck: Azure
        • MITRE Att&CK: Azure Security Control Mapping
  • Microsoft Resources
    • Microsoft Incident Response Ninja Hub
    • Microsoft Defender XDR Ninja Hub
  • Azure Threat Research Matrix (ATRM)
  • Security Research & Resources
    • Azure Goat
    • Azure Security Research
      • Azure Related CVEs
  • Defender XDR
    • Defender XDR Overview
    • Defender XDR Licensing
    • Defender XDR Default Retention
    • Defender XDR Advanced Hunting Table Schemas
    • Automated Response Requirements
    • Supported Response Actions
  • Azure Sentinel
    • Sentinel Overview
    • Azure Sentinel Deployments
    • Supported Data
    • Workbook, Playbook, Notebook Comparison
    • Sentinel Workbooks
    • Entities
    • User and Entity Behavior Analytics
    • Anomaly Detection
    • Mult-Stage Attack Detection
    • Sentinel: Az CLI
  • Microsoft Defender
    • Microsoft Defender for Cloud References
    • Defender for Cloud: Az CLI
  • Azure Policy
    • Azure Policy
    • Azure Policy Components
    • Azure Policy Rules
    • Scope Azure Policy
    • Policy Assignments
    • Policy Effect
    • Initiative Definition
    • Policy Parameters
    • Remediation Task Structure
    • Use Cases for Azure Policy
    • Azure Policy: Az CLI
  • Intune
    • Intune Overview
    • Intune Licensing
    • Intune API Permission Scopes
    • Intune Sample Script Resources
  • Intune Logging
    • Configure Logging
    • Logging Schema References
    • Intune Queries and Resources
  • Windows Host Security
    • Windows System Architecture and OS Fundamentals
    • SysInternals
    • Basic vs Advanced Security Auditing
    • Sysmon
  • Adversary Emulation
    • AzureHound
    • AADInternals
      • Install
    • RoadTools
      • Install
    • Oh365UserFinder
    • GraphRunner
  • Incident Response
    • Incident Response
      • Azure IR Program Development Cheat Sheet
      • Azure IR Playbooks (MS Guidance)
      • Ransomware (MS Guidance)
  • Automation
    • Automation Overview
    • Logic Apps
      • How Logic Apps Work
      • Logic App Types
      • Triggers
      • Connectors
      • Conditional Logic and Control Flow
      • APIs in Logic Apps
      • Handling Large Workflows with Stateful Logic Apps
      • External Service Integration
      • Securing, Managing, and Scaling Azure Logic Apps
      • Logic Apps: Az CLI
  • Packet Analysis
    • Wireshark Cheatsheet
    • TShark Cheatsheet
    • TCPDUMP Cheatsheet
    • Protocol Analysis Basics
    • HTTP Response Code Cheatsheet
    • RFC Protocol Mappings
    • PCAP Acquisition
  • Detection Lab
    • Detection Lab Introduction
    • Account Creation Instructions
    • Enable MFA Within Azure Tenant
    • Create an Azure Admin With Cloud Shell
    • Setup and Install Instructions
  • VSCode and Code Setup
  • Deploying Code
  • Enabling Logs for Log Analytics Workspace
  • Logging Into Windows VM
  • Verifying Logs in Log Analytics Workspace
  • Creating Detections: Azure Monitor
  • Cost Management: Billing Alarms
Powered by GitBook
On this page
  • What is Azure Monitor Agent?
  • Key Features of Azure Monitor Agent:
  • Setting Up Azure Monitor Agent
  • Step-by-Step Setup for Windows and Linux Devices
  • Monitoring and Managing Azure Monitor Agent
  1. Azure Logging References
  2. Logging
  3. Compute Resources

Azure Monitor Agent

What is Azure Monitor Agent?

Azure Monitor Agent (AMA) is a lightweight and efficient data collection tool used in Azure Monitor to gather telemetry data from various sources within your infrastructure. It consolidates data collection for metrics, logs, and traces into a single agent, simplifying management and improving performance. This agent replaces the older Log Analytics Agent (MMA) and the Diagnostics Extension (WAD).

Key Features of Azure Monitor Agent:

  1. Unified Data Collection: Collects metrics, logs, and traces across different Azure and non-Azure environments.

  2. Efficiency: Optimized for performance, reducing resource consumption on monitored machines.

  3. Flexible Configuration: Supports multiple data collection rules (DCRs) for granular data collection.

  4. Scalability: Scales to meet the needs of large, complex environments.

  5. Security: Enhanced security features to ensure data integrity and confidentiality.

Setting Up Azure Monitor Agent

Prerequisites:

  • An Azure subscription.

  • Azure CLI installed.

  • Appropriate permissions in Azure.

Step-by-Step Setup for Windows and Linux Devices

1. Create a Data Collection Rule (DCR):

Data Collection Rules define what data to collect and where to send it.

az monitor data-collection rule create --resource-group <ResourceGroup> --name <DCRName> --location <Location>

2. Define the Data Collection Configuration:

Specify the data sources, transformation, and destinations within the DCR.

code{
  "dataFlows": [
    {
      "streams": ["Microsoft-Perf"],
      "destinations": ["<LogAnalyticsWorkspace>"]
    }
  ],
  "destinations": {
    "logAnalytics": [
      {
        "workspaceResourceId": "<LogAnalyticsWorkspaceResourceID>"
      }
    ]
  }
}

3. Install the Azure Monitor Agent on Windows:

Option 1: Using the Azure Portal

  1. Navigate to Azure Monitor > Settings > Agents > Azure Monitor Agent.

  2. Click on + Add and follow the wizard to select the appropriate scope (VM or VMSS).

  3. Complete the installation by associating the DCR.

Option 2: Using PowerShell

# Download the AMA installer
Invoke-WebRequest -Uri https://aka.ms/InstallAzureMonitorAgent -OutFile InstallAzureMonitorAgent.ps1

# Execute the installer
.\InstallAzureMonitorAgent.ps1

# Link the VM to the DCR
$vm = Get-AzVM -ResourceGroupName <ResourceGroup> -Name <VMName>
Set-AzVMExtension -ResourceGroupName <ResourceGroup> -VMName <VMName> -Name "AzureMonitorWindowsAgent" -Publisher "Microsoft.Azure.Monitor" -Type "AzureMonitorWindowsAgent" -TypeHandlerVersion "1.0" -Settings @{
    "dataCollectionRuleId" = "/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/Microsoft.Insights/dataCollectionRules/<DCRName>"
}

4. Install the Azure Monitor Agent on Linux:

Option 1: Using the Azure Portal

  1. Navigate to Azure Monitor > Settings > Agents > Azure Monitor Agent.

  2. Click on + Add and follow the wizard to select the appropriate scope (VM or VMSS).

  3. Complete the installation by associating the DCR.

Option 2: Using Azure CLI

# Download and install the AMA
wget https://aka.ms/InstallAzureMonitorAgentLinux -O InstallAzureMonitorAgentLinux.sh
chmod +x InstallAzureMonitorAgentLinux.sh
sudo ./InstallAzureMonitorAgentLinux.sh

# Link the VM to the DCR
az vm extension set \
  --resource-group <ResourceGroup> \
  --vm-name <VMName> \
  --name AzureMonitorLinuxAgent \
  --publisher Microsoft.Azure.Monitor \
  --version 1.0 \
  --settings '{"dataCollectionRuleId":"/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/Microsoft.Insights/dataCollectionRules/<DCRName>"}'

Monitoring and Managing Azure Monitor Agent

  1. Verification: Ensure the agent is running and data is being collected correctly.

    • Check the status of the agent service.

    • Verify data in the Log Analytics Workspace.

  2. Updating AMA: Azure Monitor Agent updates are managed automatically through Azure Update Management. You can also manually update if required.

  3. Troubleshooting:

    • Review logs and events related to the agent.

    • Check Azure Monitor diagnostic settings and review telemetry data.

Last updated 9 months ago