turbot/azure_insights

Query: sql_database_age_table

Usage

powerpipe query azure_insights.query.sql_database_age_table

SQL

select
d.name as "Name",
d.database_id as "Database ID",
now()::date - d.creation_date::date as "Age in Days",
d.creation_date as "Create Date",
d.status as "Status",
sub.title as "Subscription",
d.subscription_id as "Subscription ID",
d.resource_group as "Resource Group",
d.region as "Region",
d.id as "ID"
from
azure_sql_database as d,
azure_subscription as sub
where
d.subscription_id = sub.subscription_id
order by
d.creation_date,
d.name;

Dashboards

The query is used in the dashboards: