turbot/azure_insights

Query: postgresql_servers_for_key_vault_key

Usage

powerpipe query azure_insights.query.postgresql_servers_for_key_vault_key

SQL

select
lower(s.id) as postgresql_server_id
from
azure_postgresql_server as s,
jsonb_array_elements(server_keys) as sk
left join azure_key_vault_key_version as v on lower(sk ->> 'ServerKeyUri') = lower(v.key_uri_with_version)
where
lower(split_part(v.id, '/versions', 1)) = $1
and v.subscription_id = split_part($1, '/', 3);