Skip to main content

List Virtual Machines

Retrieve all virtual machines across subscriptions

Response

value
array
Array of virtual machine objects
subscriptionId
string
Azure subscription ID
name
string
Virtual machine name
location
string
Azure region location
resourceGroup
string
Resource group containing the VM

Error Responses

Status Codes:
  • 401 - Unauthorized
  • 500 - Internal server error

Create Virtual Machine

Create a new virtual machine with networking resources

Request Body

subscriptionId
string
required
Azure subscription ID
rgName
string
required
Resource group name (will be created if it doesn’t exist)
location
string
required
Azure region for the VM (e.g., “westeurope”, “eastus”)
vmName
string
required
Name for the new virtual machine

Response

message
string
Success message
vmId
string
Full Azure resource ID of the created VM

VM Configuration

The endpoint automatically creates:
  • Virtual Network: {vmName}-vnet with address space 10.0.0.0/16
  • Subnet: {vmName}-subnet with address prefix 10.0.0.0/24
  • Public IP: {vmName}-ip (Standard SKU, Static allocation)
  • Network Interface: {vmName}-nic
  • VM Image: Ubuntu Server 18.04-LTS
  • VM Size: Standard_B1s
  • Admin Username: azureuser
  • Admin Password: Azure123456! (test only)

Error Responses

Status Codes:
  • 200 - VM created successfully
  • 400 - Missing required parameters
  • 401 - Unauthorized
  • 500 - Internal server error

Delete Virtual Machine

Delete a virtual machine and its associated resources
This operation deletes the VM, OS disk, network interface, and public IP address.

Request Body

subscriptionId
string
required
Azure subscription ID
rgName
string
required
Resource group name
vmName
string
required
Virtual machine name to delete

Response

message
string
Success message confirming deletion

Error Responses

Status Codes:
  • 200 - VM deleted successfully
  • 400 - Missing required parameters
  • 401 - Unauthorized
  • 404 - VM not found
  • 500 - Internal server error

Get VM Metrics

Retrieve Azure Monitor metrics for a virtual machine

Path Parameters

vm_id
string
required
Virtual machine name

Response

vm
string
Virtual machine name
subscriptionId
string
Azure subscription ID
resourceGroup
string
Resource group name
location
string
Azure region
resourceId
string
Full Azure resource ID
metrics
array
Array of metric data
name
string
Metric name (e.g., “Percentage CPU”, “Available Memory Bytes”)
unit
string
Unit of measurement
data
array
Time series data points
timestamp
string
ISO 8601 timestamp
average
number
Average value for the time interval

Metrics Collected

  • Percentage CPU: CPU utilization percentage
  • Available Memory Percentage: Available memory as percentage
  • Available Memory Bytes: Available memory in bytes
  • CPU Credits Consumed: CPU credits used (for burstable VMs)
Timespan: Last 1 hour
Interval: 5 minutes

Error Responses

Status Codes:
  • 200 - Metrics retrieved successfully
  • 401 - Unauthorized
  • 404 - VM not found
  • 500 - Internal server error

Get Agent Status

Check installed monitoring agents on a VM

Path Parameters

vm_id
string
required
Virtual machine name

Response

vm
string
Virtual machine name
subscriptionId
string
Azure subscription ID
resourceGroup
string
Resource group name
extensions
array
List of installed extension names
hasMMA
boolean
Whether Microsoft Monitoring Agent is installed
hasAMA_Linux
boolean
Whether Azure Monitor Linux Agent is installed
hasAMA_Windows
boolean
Whether Azure Monitor Windows Agent is installed

Error Responses

Status Codes:
  • 200 - Agent status retrieved
  • 401 - Unauthorized
  • 404 - VM not found
  • 500 - Internal server error

Install Azure Monitor Agent

Install Azure Monitor Agent (AMA) on a virtual machine

Path Parameters

vm_id
string
required
Virtual machine name

Response

message
string
Status message (“AMA already installed” or “AMA installed”)
extension
string
Extension name (only when newly installed)
extensions
array
List of extensions (only when already installed)

Behavior

  • Automatically detects Windows vs Linux OS
  • Installs appropriate agent:
    • Windows: AzureMonitorWindowsAgent
    • Linux: AzureMonitorLinuxAgent
  • Skips installation if agent already exists
  • Uses version 1.0 with auto-upgrade enabled

Error Responses

Status Codes:
  • 200 - Agent installed or already present
  • 401 - Unauthorized
  • 404 - VM not found
  • 500 - Internal server error

Build docs developers (and LLMs) love