steampipe plugin install azure

Table: azure_compute_snapshot - Query Azure Compute Snapshots using SQL

Azure Compute Snapshots are a resource within Microsoft Azure that allows you to create point-in-time backups of Azure managed disks, native blobs, or other data. These snapshots are read-only and can be used for data backup, disaster recovery, or migrating data across different regions or subscriptions. Azure Compute Snapshots help ensure data durability and accessibility, and are crucial for maintaining data integrity and system resilience in Azure.

Table Usage Guide

The azure_compute_snapshot table provides insights into the snapshots within Azure Compute. As a system administrator or DevOps engineer, explore snapshot-specific details through this table, including creation time, disk size, and status. Utilize it to uncover information about snapshots, such as those associated with specific virtual machines, the state of these snapshots, and their usage for data backup or disaster recovery.

Examples

Disk info of each snapshot

Discover the specifics of each snapshot in your Azure Compute service, such as disk size and region, to better manage your storage resources and understand where your data is physically located.

select
name,
split_part(disk_access_id, '/', 8) as disk_name,
disk_encryption_set_id,
disk_size_gb,
region
from
azure_compute_snapshot;
Error: SQLite does not support split_part function.

List of snapshots which are publicly accessible

Determine the areas in which snapshots are set to be publicly accessible. This is useful for identifying potential security risks and ensuring appropriate access controls are in place.

select
name,
network_access_policy
from
azure_compute_snapshot
where
network_access_policy = 'AllowAll';
select
name,
network_access_policy
from
azure_compute_snapshot
where
network_access_policy = 'AllowAll';

List of all incremental type snapshots

Explore which snapshots in your Azure Compute resources are of the incremental type. This can help manage storage efficiently and reduce costs by identifying and focusing on snapshots that only capture changes since the last snapshot.

select
name,
incremental
from
azure_compute_snapshot
where
incremental;
select
name,
incremental
from
azure_compute_snapshot
where
incremental = 1;

Schema for azure_compute_snapshot

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
cloud_environmenttextThe Azure Cloud Environment.
create_optiontextSpecifies the possible sources of a disk's creation
disk_access_idtextARM id of the DiskAccess resource for using private endpoints on disks
disk_encryption_set_idtextResourceId of the disk encryption set to use for enabling encryption at rest
disk_size_bytesbigintThe size of the disk in bytes
disk_size_gbbigintThe size of the disk to create
encryption_setting_collection_enabledbooleanSpecifies whether the encryption is enables, or not
encryption_setting_versiontextDescribes what type of encryption is used for the disks
encryption_settingsjsonbA list of encryption settings, one for each disk volume
encryption_typetextThe type of the encryption
gallery_image_reference_idtextA relative uri containing either a Platform Image Repository or user image reference
gallery_reference_lunbigintSpecifies the index that indicates which of the data disks in the image to use
hyperv_generationtextSpecifies the hypervisor generation of the Virtual Machine
idtextThe unique id identifying the resource in subscription
image_reference_idtextA relative uri containing either a Platform Image Repository or user image reference
image_reference_lunbigintSpecifies the index that indicates which of the data disks in the image to use
incrementalbooleanSpecifies whether a snapshot is incremental, or not
nametext=The friendly name that identifies the snapshot
network_access_policytextContains the type of access
os_typetextContains the type of operating system
provisioning_statetextThe disk provisioning state
regiontextThe Azure region/location in which the resource is located.
resource_grouptext=The resource group which holds this resource.
sku_nametextThe snapshot sku name
sku_tiertextThe sku tier
source_resource_idtextARM id of the source snapshot or disk
source_unique_idtextAn unique id identifying the source of this resource
source_uritextAn URI of a blob to be imported into a managed disk
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
storage_account_idtextThe Azure Resource Manager identifier of the storage account containing the blob to import as a disk
subscription_idtext=, !=, ~~, ~~*, !~~, !~~*The Azure Subscription ID in which the resource is located.
tagsjsonbA map of tags for the resource.
time_createdtimestamp with time zoneThe time when the snapshot was created
titletextTitle of the resource.
typetextThe type of the resource in Azure
unique_idtextAn unique Guid identifying the resource
upload_size_bytesbigintThe size of the contents of the upload including the VHD footer
virtual_machinesjsonbA list of references to all virtual machines in the availability 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_snapshot