Azure Fleet Deployment: Cloudamize Agent Mass Installation via Azure Run Command

Overview

This Knowledge Base article provides a step-by-step guide on how to perform mass, non-interactive installations of the Cloudamize Agent across your Azure Virtual Machine (VM) and Virtual Machine Scale Set (VMSS) fleet using Azure Run Command.

Azure Run Command uses the built-in Azure VM Agent (waagent on Linux, Azure Windows VM Agent on Windows) to execute PowerShell or shell scripts remotely within an Azure VM. This enables administrators to deploy software at scale without requiring public IP addresses, direct SSH/RDP connectivity, or management port access on Network Security Groups (NSGs).

Note: The Azure Run Command steps in this article are provided as guidance for using third-party deployment tooling with the Cloudamize Agent. Cloudamize has not validated or tested these Azure deployment workflows end to end. Review and test the process in your own Azure environment before using it for production deployments.

Prerequisites

Before deploying the Cloudamize Agent across your Azure fleet, verify that all target nodes comply with the official Cloudamize Agent Installation Prerequisites and meet the following Azure-specific requirements:

  • Official Cloudamize Prerequisites: Review OS compatibility, system resource requirements, and regional proxy/endpoint settings in the Agent Installation Prerequisites KB.

  • Network & Outbound Access: Target instances must have outbound access on TCP Port 443 directly or via a NAT Gateway/Proxy to your assigned Cloudamize regional endpoint:

    • US Region: am.cloudamize.com

    • EU Region: am-de.cloudamize.com

    • UAE Region: am-ae.cloudamize.com

  • Azure VM Guest Agent: Target virtual machines must have the Azure VM Guest Agent installed and in a Ready state.

  • Azure RBAC Permissions: Your Azure account or automation service principal requires the Microsoft.Compute/virtualMachines/runCommand/action permission (included in roles such as Virtual Machine Contributor or Contributor).

  • Console Access: Ensure you have access to your Cloudamize Console to copy your environment-specific installation command and Customer Key.

Step-by-Step Installation Instructions

Step 1: Prepare Your Installation Command

Important Note on Region Endpoints & Customer Keys:

The installer URL domain and custkey / customerkey parameters depend on the specific region where your Cloudamize assessment is provisioned (e.g., US, EU, or UAE) and your unique account credentials. Always copy the exact command and key directly from your Cloudamize Console.


For Linux Fleet (RunShellScript):

#Bash
sh <(curl 'https://am.cloudamize.com/cxf/downloadFileV3?custkey=<YOUR_CUSTOMER_KEY>&filename=installCloudamizeAgentV2.sh' -L)

(Replace am.cloudamize.com with your regional endpoint domain if using EU or UAE, and replace YOUR_CUSTOMER_KEY with your actual Customer Key).

For Windows Fleet (RunPowerShellScript):

#PowerShell
$msiPath = "$env:TEMP\cloudamizeAgent.msi"
Invoke-WebRequest -Uri "https://am.cloudamize.com/cxf/downloadFileV3?custkey=<YOUR_CUSTOMER_KEY>&filename=cloudamizeAgent.msi" -OutFile $msiPath
msiexec /i $msiPath customerkey=YOUR_CUSTOMER_KEY /qn

(Replace am.cloudamize.com with your regional endpoint domain if using EU or UAE, and replace YOUR_CUSTOMER_KEY with your actual Customer Key).

Step 2: Execute Deployment via Azure Portal or Azure CLI
Option A: Deploy via Azure Portal (Single VM or Small Fleet)
  1. Log in to the Azure Portal.

  2. Navigate to Virtual machines and select your target VM.

  3. In the left navigation menu under Operations, select Run command.

  4. Choose the command execution module:

    • Linux: Click RunShellScript

    • Windows: Click RunPowerShellScript

  5. Paste the corresponding script block into the script window and click Run.

Option B: Mass Deployment Across Resource Groups via Azure CLI / Cloud Shell

To perform mass deployment across multiple VMs in a Resource Group simultaneously, use the Azure CLI (az vm run-command invoke):

Mass Linux Fleet Deployment:
Bash
#Bash
# Save installation script locally
cat << 'EOF' > install_cloudamize.sh
#!/bin/bash
sh <(curl 'https://am.cloudamize.com/cxf/downloadFileV3?custkey=YOUR_CUSTOMER_KEY&filename=installCloudamizeAgentV2.sh' -L)
EOF

# Mass execute across all Linux VMs in a Resource Group
for vm in $(az vm list -g "rg-production" --query "[?storageProfile.osDisk.osType=='Linux'].name" -o tsv); do
  echo "Deploying Cloudamize Agent to VM: $vm"
  az vm run-command invoke \
    --resource-group "rg-production" \
    --name "$vm" \
    --command-id "RunShellScript" \
    --scripts "@install_cloudamize.sh" \
    --no-wait
done
Mass Windows Fleet Deployment:
Bash
#Bash
# Save PowerShell script locally
cat << 'EOF' > install_cloudamize.ps1
$msiPath = "$env:TEMP\cloudamizeAgent.msi"
Invoke-WebRequest -Uri "https://am.cloudamize.com/cxf/downloadFileV3?custkey=YOUR_CUSTOMER_KEY&filename=cloudamizeAgent.msi" -OutFile $msiPath
msiexec /i $msiPath customerkey=YOUR_CUSTOMER_KEY /qn
EOF

# Mass execute across all Windows VMs in a Resource Group
for vm in $(az vm list -g "rg-production" --query "[?storageProfile.osDisk.osType=='Windows'].name" -o tsv); do
  echo "Deploying Cloudamize Agent to VM: $vm"
  az vm run-command invoke \
    --resource-group "rg-production" \
    --name "$vm" \
    --command-id "RunPowerShellScript" \
    --scripts "@install_cloudamize.ps1" \
    --no-wait
done


Verification & Monitoring

Once execution completes, verify the installation status across your target VMs:

  1. View execution logs in the Azure CLI response output or under Run command > Script execution status in the Azure Portal.

  2. Verify agent services directly on target virtual machines:

    • Linux: Run systemctl status cloudamize-agent

    • Windows: Check services for Cloudamize Agent Service

  3. Log in to the Cloudamize Console and confirm that the newly registered instances appear in your node list.

Frequently Asked Questions

Why am I getting a "VM Agent is not in a ready state" error?

Azure Run Command requires the Azure Guest Agent (waagent on Linux or Windows Guest Agent) to be running and healthy. Ensure the agent service is installed, active, and able to communicate with Azure fabric endpoints.

Can I automate this across all newly created Azure VMs automatically?

Yes. You can create an Azure Policy with the DeployIfNotExists effect targeting Microsoft.Compute/virtualMachines/runCommands or deploy via the Custom Script Extension during VM provisioning.

Do I need public IP addresses or open inbound RDP/SSH ports on NSGs?

No. Azure Run Command executes natively through the guest VM agent using outbound fabric polling over HTTPS (Port 443). No inbound network ports need to be exposed.


If you have any queries, please get in touch with the helpdesk via our Helpdesk Portal or by email at helpdesk@cloudamize.com.