'How to return the list of KeyVault names associated with encrypted columns in a DB?
I have a number of databases, which in turn have a number of encrypted columns tied to a number of KeyVaults (same subscription). Although I know you can easily query the DB itself to get the key names of each encrypted column, I'm struggling to see or find via SQL or PS as to whether there is a way to return any of the Azure side information, namely the keyvault name? Realistically in its simplest form, I'm just after a script that will return: Column Name -- Key Name -- KeyVault
Querying DB gives me first two items, but I'm not convinced the Azure side tie up is actually held in the DB, hence thinking this might be one for PowerShell..
SELECT \* FROM sys.columns c
INNER JOIN sys.column_encryption_keys k ON c.column_encryption_key_id = k.column_encryption_key_id
INNER JOIN sys.tables t ON c.object_id = t.object_id
WHERE encryption_type IS NOT NULL
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
