Greater Heights Ltd

Azure & .net Software Consultants

Azure Key Vault Logging

Audit logging your Azure Key Vaults is good practice. You need to know who accessed or attempted to access your key vault and you need to be able to set alerts on these metrics. The simplest way to achieve this is by sending your Key Vault audit logs to Application Insights. Include this as part of the ARM template used to create the key vault.

To enable logging, add the following resource to your ARM template in the ‘resources’ section within the Key Vault.

'/Microsoft.Insights/', parameters('resourceDiagName'))]",
          "dependsOn": [
          "properties": {
            "metrics": [
                "retentionPolicy": {
            "logs": [

The essential parts are in the 'workspaceId' property

 'Microsoft.OperationalInsights/workspaces', parameters('logAnalytics'))]"

The parameter logAnalyticsresourceGroup is the resource group in which you created your Log Analytics workspace and your Application Insights instance.

The parameter 'logAnalytics' is the name of the Log Analytics workspace where you want your logs to be available.

The full example ARM template is available here