Deploy Qualys Scanner from Azure Marketplace Using CLI
This section describes how to deploy the Qualys Virtual Scanner Appliance from the Azure Marketplace using Azure CLI commands and configure the required deployment parameters.
Prerequisites
To deploy Qualys scanner via Azure CLI with an image from Azure Marketplace, the following are prerequisites:
- Access to running Azure CLI, either launched from Azure Cloud Shell in the Azure portal or your local installation of Azure CLI
- 14-digit PERSCODE obtained from Qualys
Use the Azure CLI command to query for the latest version of the Qualys Virtual Scanner Appliance image in the marketplace by using the following Azure CLI command:
az vm image list --publisher qualysguard --sku qvsa --all --query '[-1]' --output table
- Prepare userdata.txt file with mandatory PERSCODE and optional PROXY_URL:
Example of userdata.txt:
PERSCODE=70xxxxxxxxxxxxPROXY_URL=user:pass@proxyhost:443 - Run the CLI command to create the VM scanner from the latest qVSA image on Azure Marketplace:
az vm create \ --name <vm name> \ --resource-group <name of resource_group> \ --image "$(az vm image list --publisher qualysguard --offer qualys-virtual-scanner --sku qvsa --all --query '[-1].urn' -o tsv)" \ --size <vm size> \ --authentication-type password \ --admin-username azureuser \ --admin-password "PasswordNotUsed123!" \ --public-ip-address "" \ --subnet "<subnet id>" \ --boot-diagnostics-storage <name of storage_account> \ --user-data @<path to userdata file>Azure requires an admin-username and an admin-password or an SSH key to create a VM, but qVSA does not enable user login.
Enabling boot diagnostics is highly recommended for troubleshooting purposes.Example
az vm create \ --name qualys-scanner \ --resource-group myRG \ --image "$(az vm image list --publisher qualysguard --offer qualys-virtual-scanner --sku qvsa --all --query '[-1].urn' -o tsv)" \ --size Standard_F4s_v2 \ --authentication-type password \ --admin-username azureuser \ --admin-password "PasswordNotUsed123!" \ --public-ip-address "" \ --subnet "/subscriptions/abc26da1-7e18-4eb9-9c0a-9bcb465f4e20/resourceGroups/Scanner-RG/providers/Microsoft.Network/virtualNetworks/ScannerGrp-VN_10.95.4.0-22/subnets/mySubnet-Net" \ --boot-diagnostics-storage myStorageAccount \ --user-data @userdata.txt