turbot/azure_insights

Query: eventhub_namespaces_for_key_vault_key

Usage

powerpipe query azure_insights.query.eventhub_namespaces_for_key_vault_key

SQL

select
lower(n.id) as eventhub_namespace_id
from
azure_eventhub_namespace as n,
jsonb_array_elements(encryption -> 'keyVaultProperties') as p
left join azure_key_vault_key as k on p ->> 'keyName' = k.name
left join azure_key_vault as v on v.name = k.vault_name
where
k.resource_group = v.resource_group
and k.resource_group = n.resource_group
and lower(k.id) = $1
and k.subscription_id = split_part($1, '/', 3);