Gallery › Automation › Azure Landing Zones Library
No child resources in Automation Account
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
This policy denies the creation of child resources on the Automation Account
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDeny-AA-child-resources.alz_policy_definition.json · 54 lines
{
"name": "Deny-AA-child-resources",
"properties": {
"description": "This policy denies the creation of child resources on the Automation Account",
"displayName": "No child resources in Automation Account",
"metadata": {
"alzCloudEnvironments": [
"AzureCloud",
"AzureUSGovernment"
],
"category": "Automation",
"source": "https://github.com/Azure/Enterprise-Scale/",
"version": "1.0.0"
},
"mode": "Indexed",
"parameters": {
"effect": {
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny",
"metadata": {
"description": "Enable or disable the execution of the policy",
"displayName": "Effect"
},
"type": "String"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"in": [
"Microsoft.Automation/automationAccounts/runbooks",
"Microsoft.Automation/automationAccounts/variables",
"Microsoft.Automation/automationAccounts/modules",
"Microsoft.Automation/automationAccounts/credentials",
"Microsoft.Automation/automationAccounts/connections",
"Microsoft.Automation/automationAccounts/certificates"
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"policyType": "Custom"
},
"type": "Microsoft.Authorization/policyDefinitions"
}BylawDeny-AA-child-resources.bylaw.ps1 · 28 lines
# Converted from Deny-AA-child-resources.alz_policy_definition.json by ConvertTo-Bylaw.
Policy 'Deny-AA-child-resources' {
Properties @{
DisplayName = 'No child resources in Automation Account'
Description = 'This policy denies the creation of child resources on the Automation Account'
Category = 'Automation'
Version = '1.0.0'
Mode = 'Indexed'
Metadata = [ordered]@{ alzCloudEnvironments = @('AzureCloud', 'AzureUSGovernment'); source = 'https://github.com/Azure/Enterprise-Scale/' }
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Deny'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource * {
Require 'type is not one of 6 values' {
Field type | Must -Not -BeIn @('Microsoft.Automation/automationAccounts/runbooks', 'Microsoft.Automation/automationAccounts/variables', 'Microsoft.Automation/automationAccounts/modules', 'Microsoft.Automation/automationAccounts/credentials', 'Microsoft.Automation/automationAccounts/connections', 'Microsoft.Automation/automationAccounts/certificates') -IfPresent
}
}
Effect (Param Effect)
}Source: policy_definitions/Deny-AA-child-resources.alz_policy_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.
Bylaw