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, regionfrom 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_policyfrom azure_compute_snapshotwhere network_access_policy = 'AllowAll';
select name, network_access_policyfrom azure_compute_snapshotwhere 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, incrementalfrom azure_compute_snapshotwhere incremental;
select name, incrementalfrom azure_compute_snapshotwhere incremental = 1;
Query examples
- compute_disk_accesses_for_compute_snapshot
- compute_disk_encryption_details
- compute_disk_encryption_sets_for_compute_snapshot
- compute_snapshot_1_year_count
- compute_snapshot_24_hours_count
- compute_snapshot_30_90_days_count
- compute_snapshot_30_days_count
- compute_snapshot_90_365_days_count
- compute_snapshot_by_encryption_type
- compute_snapshot_by_os_type
- compute_snapshot_by_region
- compute_snapshot_by_subscription
- compute_snapshot_count
- compute_snapshot_create_option
- compute_snapshot_encryption_setting_collection_disabled_count
- compute_snapshot_incremental
- compute_snapshot_incremental_disabled_count
- compute_snapshot_network_access_policy
- compute_snapshot_sku_name
- compute_snapshot_storage_total
- compute_snapshot_tags
- compute_snapshot_unrestricted_network_access_count
- compute_snapshots_for_storage_account
- key_vault_keys_for_compute_snapshot
- key_vault_vaults_for_compute_snapshot
Schema for azure_compute_snapshot
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cloud_environment | text | The Azure Cloud Environment. | |
create_option | text | Specifies the possible sources of a disk's creation | |
disk_access_id | text | ARM id of the DiskAccess resource for using private endpoints on disks | |
disk_encryption_set_id | text | ResourceId of the disk encryption set to use for enabling encryption at rest | |
disk_size_bytes | bigint | The size of the disk in bytes | |
disk_size_gb | bigint | The size of the disk to create | |
encryption_setting_collection_enabled | boolean | Specifies whether the encryption is enables, or not | |
encryption_setting_version | text | Describes what type of encryption is used for the disks | |
encryption_settings | jsonb | A list of encryption settings, one for each disk volume | |
encryption_type | text | The type of the encryption | |
gallery_image_reference_id | text | A relative uri containing either a Platform Image Repository or user image reference | |
gallery_reference_lun | bigint | Specifies the index that indicates which of the data disks in the image to use | |
hyperv_generation | text | Specifies the hypervisor generation of the Virtual Machine | |
id | text | The unique id identifying the resource in subscription | |
image_reference_id | text | A relative uri containing either a Platform Image Repository or user image reference | |
image_reference_lun | bigint | Specifies the index that indicates which of the data disks in the image to use | |
incremental | boolean | Specifies whether a snapshot is incremental, or not | |
name | text | = | The friendly name that identifies the snapshot |
network_access_policy | text | Contains the type of access | |
os_type | text | Contains the type of operating system | |
provisioning_state | text | The disk provisioning state | |
region | text | The Azure region/location in which the resource is located. | |
resource_group | text | = | The resource group which holds this resource. |
sku_name | text | The snapshot sku name | |
sku_tier | text | The sku tier | |
source_resource_id | text | ARM id of the source snapshot or disk | |
source_unique_id | text | An unique id identifying the source of this resource | |
source_uri | text | An URI of a blob to be imported into a managed disk | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
storage_account_id | text | The Azure Resource Manager identifier of the storage account containing the blob to import as a disk | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
tags | jsonb | A map of tags for the resource. | |
time_created | timestamp with time zone | The time when the snapshot was created | |
title | text | Title of the resource. | |
type | text | The type of the resource in Azure | |
unique_id | text | An unique Guid identifying the resource | |
upload_size_bytes | bigint | The size of the contents of the upload including the VHD footer | |
virtual_machines | jsonb | A 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