Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.29 KB

readme.generate.md

File metadata and controls

28 lines (16 loc) · 1.29 KB

{{displayName}}

{{description}}

Try on Portal

Deploy to Azure

Try on PowerShell

$definition = New-AzureRmPolicyDefinition -Name "{{policyName}}" -DisplayName "{{displayName}}" -description "{{description}}" -Policy 'https://raw.githubusercontent.com/Azure/azure-policy-samples/master/samples/{{path}}/azurepolicy.rules.json' -Parameter 'https://raw.githubusercontent.com/Azure/azure-policy-samples/master/samples/{{path}}/azurepolicy.parameters.json' -Mode All
$definition
$assignment = New-AzureRMPolicyAssignment -Name <assignmentname> -Scope <scope> -PolicyDefinition $definition
$assignment 

Try with CLI


az policy definition create –-name "{{policyName}}" --display-name "{{displayName}}" --description "{{description}}" --rules 'https://raw.githubusercontent.com/Azure/azure-policy-samples/master/samples/{{path}}/azurepolicy.rules.json' –-params 'https://raw.githubusercontent.com/Azure/azure-policy-samples/master/samples/{{path}}/azurepolicy.parameters.json' -mode All

az policy assignment create --name <assignmentname> --scope <scope> --policy "{{policyName}}"