Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
azurepolicy.json
azurepolicy.parameters.json
azurepolicy.rules.json

README.md

Apply Diagnostic Settings for Azure Key Vault to a Regional Event Hub

This policy automatically deploys diagnostic settings for Azure Key Vault supporting a regional Event Hub as a sink point.

Try on Portal

Deploy to Azure

Try with PowerShell

$definition = New-AzPolicyDefinition -Name "apply-diagnostic-setting-keyvault-eventhub" -DisplayName "Apply Diagnostic Settings for Azure Key Vault to a Regional Event Hub" -description "This policy automatically deploys diagnostic settings for Azure Key Vault to point to a regional Event Hub." -Policy 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Monitoring/apply-diagnostic-setting-keyvault-eventhub/azurepolicy.rules.json' -Parameter 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Monitoring/apply-diagnostic-setting-keyvault-eventhub/azurepolicy.parameters.json' -Mode Indexed
$definition
$assignment = New-AzPolicyAssignment -Name <assignmentname> -Scope <scope> -profileName <profileName> -eventHubName <eventHubName> -eventHubRuleId <eventHubRuleId> -azureRegions <azureRegions> -metricsEnabled <metricsEnabled> -logsEnabled <logsEnabled> -PolicyDefinition $definition
$assignment 

Try with CLI


az policy definition create --name 'apply-diagnostic-setting-keyvault-eventhub' --display-name 'Apply Diagnostic Settings for Azure Key Vault to a regional Event Hub' --description 'This policy automatically deploys diagnostic settings to Azure Key Vault vaults supporting a regional Event Hub.' --rules 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Monitoring/apply-diagnostic-setting-keyvault-eventhub/azurepolicy.rules.json' --params 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Monitoring/apply-diagnostic-setting-keyvault-eventhub/azurepolicy.parameters.json' --mode Indexed

az policy assignment create --name <assignmentname> --scope <scope> --params "{ 'profileName': { 'value': '<profileName>' }, 'eventHubName': { 'value': '<eventHubName>' },'eventHubRuleId': { 'value': '<eventHubRuleId>' },'azureRegions': { 'value': '<azureRegions>' },'metricsEnabled': { 'value': '<metricsEnabled>' },'logsEnabled': { 'value': '<logsEnabled>' } }" --policy "apply-diagnostic-setting-keyvault-eventhub"

You can’t perform that action at this time.