You can deploy the CloudRay Agent on Azure Virtual Machines using two main approaches:

The CloudRay Agent enables secure, real-time server management and metric collection without requiring SSH access to your virtual machine.

TIP

Make sure you have a CloudRay account and locate your REG_CODE in your project dashboard.

Option 1: New Azure VM (via User Data)

Use cloud-init to automatically install and register the CloudRay Agent when provisioning a new virtual machine.

  1. In the Azure Portal, begin creating a new Virtual Machine.
  2. Under the Advanced tab, find the Custom data section.
Azure VM Custom Data cloud-init field
  1. Paste the following cloud-init compatible shell script (replace <REG_CODE>):
#!/bin/bash
curl -sSfL https://cloudray.io/install.sh | sudo bash
sudo cloudray-agent install-service --reg-code <REG_CODE>

The installation script is safe to run multiple times. It checks for existing Agent and upgrades them if a newer version is available.

  1. Complete the rest of the VM creation steps and deploy the instance.

Option 2: Existing Azure VMs

If you already have a running virtual machine, you can install the Agent manually using SSH or Azure Bastion.

  1. Connect to your VM via SSH or Azure Bastion
  2. Run the following commands:
curl -sSfL https://cloudray.io/install.sh | sudo bash
sudo cloudray-agent install-service --reg-code <REG_CODE>
  1. Head to your CloudRay dashboard, go to Machines, and verify that your Azure VM is listed as connected.

Alternative: Connect via SSH

If you can’t install the CloudRay Agent, you can still manage your machines using SSH. See SSH-Based Servers to get started with traditional SSH connections.