Community-Policy/policyDefinitions/Automation/audit-encryption-of-automat...
..
README.md
azurepolicy.json
azurepolicy.parameters.json
azurepolicy.rules.json

README.md

Audit encryption of Automation account variables

It is important to enable encryption of Automation account variable assets when storing sensitive data.

Try on Portal

Deploy to Azure

Try with Powershell

$definition = New-AzPolicyDefinition -Name "audit-automation-account-variable-encryption" -DisplayName "Audit encryption of Automation account variables" -description "It is important to enable encryption of Automation account variable assets when storing sensitive data." -Policy 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Automation/audit-automation-account-variable-encryption/azurepolicy.rules.json' -Parameter 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Automation/audit-automation-account-variable-encryption/azurepolicy.parameters.json' -Mode All
$definition
$assignment = New-AzPolicyAssignment -Name <assignmentname> -Scope <scope>  -PolicyDefinition $definition
$assignment 

Try with CLI

az policy definition create --name 'audit-automation-account-variable-encryption' --display-name 'Audit encryption of Automation account variables' --description 'It is important to enable encryption of Automation account variable assets when storing sensitive data.' --rules 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Automation/audit-automation-account-variable-encryption/azurepolicy.rules.json' --params 'https://raw.githubusercontent.com/Azure/azure-policy/master/samples/Automation/audit-automation-account-variable-encryption/azurepolicy.parameters.json' --mode All

az policy assignment create --name <assignmentname> --scope <scope> --policy "audit-automation-account-variable-encryption"