steampipe plugin install azure

Table: azure_compute_virtual_machine_scale_set_vm - Query Azure Compute Virtual Machine Scale Set VMs using SQL

Azure Compute Virtual Machine Scale Sets are a group of identical, load-balanced VMs. They are designed to support true auto-scale, no pre-provisioning of VMs is required, and they let you centrally manage, configure, and update a large number of VMs. With auto-scale, VMs get automatically created and added to a load balancer and get removed when not in use.

Table Usage Guide

The azure_compute_virtual_machine_scale_set_vm table provides insights into the individual virtual machines within an Azure Virtual Machine Scale Set. As a system administrator, you can explore VM-specific details through this table, including the current state, configuration, and associated metadata. This table is useful for monitoring the status and performance of each VM in a scale set, enabling efficient resource management and troubleshooting.

Examples

Basic info

Analyze the settings to understand the distribution and organization of your virtual machine scale sets in Azure. This can be helpful to manage resources and monitor regional deployment of your virtual machines effectively.

select
name,
scale_set_name,
instance_id,
id,
vm_id,
region,
resource_group
from
azure_compute_virtual_machine_scale_set_vm;
select
name,
scale_set_name,
instance_id,
id,
vm_id,
region,
resource_group
from
azure_compute_virtual_machine_scale_set_vm;

List Standard tier scale set virtual machine

Determine the areas in which standard tier virtual machine scale sets are being used within your Azure environment. This allows for efficient resource allocation and cost management.

select
name,
scale_set_name,
id,
sku_name,
sku_tier
from
azure_compute_virtual_machine_scale_set_vm
where
sku_tier = 'Standard';
select
name,
scale_set_name,
id,
sku_name,
sku_tier
from
azure_compute_virtual_machine_scale_set_vm
where
sku_tier = 'Standard';

List all virtual machines under a specific scale set

Explore which virtual machines are part of a particular scale set in Azure. This is useful for managing resources and understanding the distribution of your virtual machines within specific scale sets.

select
name,
scale_set_name,
id,
sku_name,
sku_tier
from
azure_compute_virtual_machine_scale_set_vm
where
scale_set_name = 'my_vm_scale';
select
name,
scale_set_name,
id,
sku_name,
sku_tier
from
azure_compute_virtual_machine_scale_set_vm
where
scale_set_name = 'my_vm_scale';

View Network Security Group Rules for a virtual machine

Determine the security rules applied to a specific virtual machine within a network. This is useful for assessing the security measures in place and identifying any potential vulnerabilities or areas for improvement.

select
vm.name,
nsg.name,
jsonb_pretty(security_rules)
from
azure_compute_virtual_machine_scale_set_vm as vm,
jsonb_array_elements(vm.virtual_machine_network_profile) as vm_nic,
azure_network_security_group as nsg,
jsonb_array_elements(nsg.network_interfaces) as nsg_int
where
lower(vm_nic ->> 'id') = lower(nsg_int ->> 'id')
and vm.name = 'warehouse-01';
select
vm.name,
nsg.name,
security_rules
from
azure_compute_virtual_machine_scale_set_vm as vm,
json_each(vm.virtual_machine_network_profile) as vm_nic,
azure_network_security_group as nsg,
json_each(nsg.network_interfaces) as nsg_int
where
lower(json_extract(vm_nic.value, '$.id')) = lower(json_extract(nsg_int.value, '$.id'))
and vm.name = 'warehouse-01';

View power state of virtual machines

Determine the power state of virtual machines in all scale sets.

select
vm.name,
vm.power_state
from
azure_compute_virtual_machine_scale_set_vm as vm;
select
vm.name,
vm.power_state
from
azure_compute_virtual_machine_scale_set_vm as vm;

Schema for azure_compute_virtual_machine_scale_set_vm

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
additional_capabilitiesjsonbSpecifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
availability_setjsonbSpecifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability.
cloud_environmenttextThe Azure Cloud Environment.
idtextThe unique id identifying the resource in subscription.
instance_idtext=The virtual machine instance ID.
latest_model_appliedbooleanSpecifies whether the latest model has been applied to the virtual machine.
license_typetextSpecifies that the image or disk that is being used was licensed on-premises.
locationtextThe location of the resource.
model_definition_appliedtextSpecifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine.
nametextName of the scale set VM.
planjsonbSpecifies information about the marketplace image used to create the virtual machine.
power_statetextSpecifies the power state of the VM.
protection_policyjsonbSpecifies the protection policy of the virtual machine.
provisioning_statetextThe provisioning state.
regiontextThe Azure region/location in which the resource is located.
resource_grouptext=The resource group which holds this resource.
resourcesjsonbThe virtual machine child extension resources.
scale_set_nametext=Name of the scale set.
sku_capacitybigintSpecifies the capacity of virtual machines in a scale set virtual machine.
sku_nametextThe sku name.
sku_tiertextSpecifies the tier of virtual machines in a scale set virtual machine.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subscription_idtext=, !=, ~~, ~~*, !~~, !~~*The Azure Subscription ID in which the resource is located.
tagsjsonbA map of tags for the resource.
tags_srcjsonbResource tags.
titletextTitle of the resource.
typetextThe type of the resource in Azure.
upgrade_policyjsonbThe upgrade policy for the scale set.
virtual_machine_diagnostics_profilejsonbSpecifies the boot diagnostic settings state.
virtual_machine_hardware_profilejsonbSpecifies the hardware settings for the virtual machine.
virtual_machine_network_profilejsonbSpecifies properties of the network interfaces of the virtual machines.
virtual_machine_network_profile_configurationjsonbSpecifies the network profile configuration of the virtual machine.
virtual_machine_os_profilejsonbSpecifies the operating system settings for the virtual machines.
virtual_machine_security_profilejsonbSpecifies the Security related profile settings for the virtual machine.
virtual_machine_storage_profilejsonbSSpecifies the storage settings for the virtual machine disks.
vm_idtextAzure virtual machine unique ID.
zonesjsonbThe Logical zone list for scale set.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- azure

You can pass the configuration to the command with the --config argument:

steampipe_export_azure --config '<your_config>' azure_compute_virtual_machine_scale_set_vm