Skip to content

Instantly share code, notes, and snippets.

@jesseloudon
Created March 19, 2021 00:09
Show Gist options
  • Save jesseloudon/d82fbd3130d2edc7572383abbadc9ddf to your computer and use it in GitHub Desktop.
Save jesseloudon/d82fbd3130d2edc7572383abbadc9ddf to your computer and use it in GitHub Desktop.
AzureSpringClean2021 DINE policy example
targetScope = 'subscription'
// PARAMETERS
param bicepExampleInitiativeId string
param assignmentIdentityLocation string
param assignmentEnforcementMode string
// RESOURCES
resource bicepExampleAssignment 'Microsoft.Authorization/policyAssignments@2020-09-01' = {
name: 'bicepExampleAssignment'
location: assignmentIdentityLocation
identity: {
type: 'SystemAssigned'
}
properties: {
displayName: 'Bicep Example Assignment'
description: 'Bicep Example Assignment'
enforcementMode: assignmentEnforcementMode
metadata: {
source: 'Bicep'
version: '0.1.0'
}
policyDefinitionId: bicepExampleInitiativeId
nonComplianceMessages: [
{
message: 'Resource is not compliant with a DeployIfNotExists policy'
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment