GitHunt
RO

Roberto-A-Cardenas/Azure-vm-monitoring

Azure VM Monitoring with Log Analytics, Alerts, and Action Groups using Terraform Deploys and monitors a Linux VM in Azure with automated diagnostics, performance metrics, alert rules, and a custom monitoring diagram — fully IaC powered.

Azure VM Monitoring

IaC
Cloud
Monitoring
License: MIT


Overview

This project provisions a monitored Linux Virtual Machine in Microsoft Azure using Terraform. It configures full-stack monitoring via Log Analytics Workspace and sets up alerting with an action group that sends an email on high CPU usage.


Architecture

Azure Diagram


Components

  • Azure Linux VM (Ubuntu 20.04 LTS)
  • Virtual Network and Subnet
  • Network Interface + Public IP
  • Log Analytics Workspace
  • Boot Diagnostics
  • Azure Monitor + Alerts
  • Email Action Group

Folder Structure

azure-vm-monitoring/
├── .gitignore
├── LICENSE
├── README.md
└── terraform/
    ├── assets/
    │   └── azure-diagram.png
    ├── user-data/
    │   └── cloud-init.yaml
    ├── main.tf
    ├── monitoring.tf
    ├── network.tf
    ├── outputs.tf
    ├── provider.tf
    ├── random.tf
    ├── storage.tf
    ├── variables.tf
    ├── versions.tf
    └── vm.tf

Setup Instructions

  1. Clone the repo

    git clone https://github.com/roberto-a-cardenas/azure-vm-monitoring.git
    cd azure-vm-monitoring/terraform
  2. Initialize Terraform

    terraform init
  3. Preview and apply changes

    terraform plan
    terraform apply

Monitoring Details

  • Azure Monitor tracks CPU utilization.
  • Log Analytics Workspace collects logs and metrics.
  • Email alerts are triggered when CPU > 70% for 5 minutes.

License

This project is licensed under the MIT License.

Author

Roberto-A-CardenasGitHub

Languages

HCL100.0%

Contributors

MIT License
Created May 29, 2025
Updated May 29, 2025