turbot/azure_insights

Query: key_vault_vaults_for_sql_server

Usage

powerpipe query azure_insights.query.key_vault_vaults_for_sql_server

SQL

select
lower(id) as key_vault_id
from
azure_key_vault
where
name in (
select
split_part(ep ->> 'serverKeyName','_',1) as key_vault_name
from
azure_sql_server,
jsonb_array_elements(encryption_protector) as ep
where
lower(id) = $1
and subscription_id = split_part($1, '/', 3)
and ep ->> 'kind' = 'azurekeyvault'
);