steampipe plugin install azure

Table: azure_compute_disk - Query Azure Compute Disks using SQL

Azure Compute Disk is a resource within Microsoft Azure that allows you to create and manage disks for your virtual machines. These disks can be used as system disks or data disks and come in different types, including standard HDD, standard SSD, and premium SSD. Azure Compute Disk also supports disk encryption for enhanced security.

Table Usage Guide

The azure_compute_disk table provides insights into the disks used in Azure Compute. As a system administrator or developer, you can explore disk-specific details through this table, including the type, size, location, and encryption settings of each disk. Utilize it to manage disk resources effectively, ensuring optimal allocation and enhanced security.

Examples

List of all premium tier compute disks

Determine the areas in which premium tier compute disks are being utilized across your Azure environment. This can help in resource management and cost optimization by identifying areas of high-end usage.

select
name,
sku_name,
sku_tier
from
azure_compute_disk
where
sku_tier = 'Premium';
select
name,
sku_name,
sku_tier
from
azure_compute_disk
where
sku_tier = 'Premium';

List of unattached disks

Discover the segments that consist of unused storage resources within your Azure infrastructure. This can aid in optimizing resource allocation and reducing unnecessary costs.

select
name,
disk_state
from
azure_compute_disk
where
disk_state = 'Unattached';
select
name,
disk_state
from
azure_compute_disk
where
disk_state = 'Unattached';

Size and performance info of each disk

Gain insights into the performance and size of each disk in your Azure Compute service. This helps in optimizing resource allocation and identifying potential performance bottlenecks.

select
name,
disk_size_gb as disk_size,
disk_iops_read_only as disk_iops_read_only,
disk_iops_read_write as provision_iops,
disk_iops_mbps_read_write as bandwidth,
disk_iops_mbps_read_only as disk_mbps_read_write
from
azure_compute_disk;
select
name,
disk_size_gb as disk_size,
disk_iops_read_only as disk_iops_read_only,
disk_iops_read_write as provision_iops,
disk_iops_mbps_read_write as bandwidth,
disk_iops_mbps_read_only as disk_mbps_read_write
from
azure_compute_disk;

List of compute disks which are not available in multiple az

Determine the areas in which Azure Compute Disks are not available across multiple availability zones. This is useful for identifying potential vulnerabilities in your system's redundancy and disaster recovery capabilities.

select
name,
az,
region
from
azure_compute_disk
cross join jsonb_array_elements(zones) az
where
zones is not null;
select
name,
az.value as az,
region
from
azure_compute_disk,
json_each(zones) az
where
zones is not null;

List of compute disks which are not encrypted with customer key

Discover the segments that utilize compute disks not encrypted with a customer key, enabling you to identify potential security risks and take necessary actions to enhance data protection.

select
name,
encryption_type
from
azure_compute_disk
where
encryption_type <> 'EncryptionAtRestWithCustomerKey';
select
name,
encryption_type
from
azure_compute_disk
where
encryption_type != 'EncryptionAtRestWithCustomerKey';

Schema for azure_compute_disk

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
cloud_environmenttextThe Azure Cloud Environment.
creation_data_gallery_image_reference_idtextThe ARM id of the shared galley image version from which disk was created
creation_data_gallery_image_reference_lunbigintAn index that indicates which of the data disks in the image to use, if the disk is created from an image's data disk
creation_data_image_reference_idtextA relative uri containing either a Platform Image Repository or user image reference
creation_data_image_reference_lunbigintIf the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null
creation_data_optiontextThis enumerates the possible sources of a disk's creation
creation_data_source_resource_idtextThe ARM id of the source snapshot or disk
creation_data_source_unique_idtextAn unique id identifying the source of this resource
creation_data_source_uritextThe URI of a blob to be imported into a managed disk
creation_data_storage_account_idtextThe Azure Resource Manager identifier of the storage account containing the blob to import as a disk
creation_data_upload_size_bytesbigintThis is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer)
disk_access_idtextARM id of the DiskAccess resource for using private endpoints on disks
disk_iops_mbps_read_onlybigintThe total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10
disk_iops_mbps_read_writebigintThe bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10
disk_iops_read_onlydouble precisionThe total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes
disk_iops_read_writedouble precisionThe number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes
disk_size_bytesdouble precisionThe size of the disk in bytes
disk_size_gbbigintIf this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size
disk_statetextThis enumerates the possible state of the disk
encryption_disk_encryption_set_idtextResourceId of the disk encryption set to use for enabling encryption at rest
encryption_settings_collection_enabledbooleanShows the status of the encryption settings for the disk
encryption_settings_collection_settingsjsonbA collection of encryption settings, one for each disk volume
encryption_settings_collection_versiontextDescribes the type of encryption is used for the disks. '1.0' corresponds to Azure Disk Encryption with AAD app. '1.1' corresponds to Azure Disk Encryption
encryption_typetextThe type of key used to encrypt the data of the disk
hyper_v_generationtextThe hypervisor generation of the Virtual Machine. Applicable to OS disks only
idtextThe unique id identifying the resource in subscription
managed_bytextA relative URI containing the ID of the VM that has the disk attached
managed_by_extendedjsonbList of relative URIs containing the IDs of the VMs that have the disk attached
max_sharesbigintThe maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time
nametext=Name of the disk
network_access_policytextPolicy for accessing the disk via network
os_typetextThe Operating System type
provisioning_statetextThe disk provisioning state
regiontextThe Azure region/location in which the resource is located.
resource_grouptext=The resource group which holds this resource.
share_infojsonbDetails of the list of all VMs that have the disk attached
sku_nametextThe disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS
sku_tiertextThe sku tier
subscription_idtextThe Azure Subscription ID in which the resource is located.
tagsjsonbA map of tags for the resource.
time_createdtimestamp with time zoneThe time when the disk was created
titletextTitle of the resource.
typetextThe type of the resource in Azure
unique_idtextUnique Guid identifying the resource
zonesjsonbThe Logical zone list for Disk

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_disk