Skip to content

Commit

Permalink
Merge pull request #181 from ElYusubov/development
Browse files Browse the repository at this point in the history
Add policy ensuring that tag values adhere to a specified format
  • Loading branch information
ElYusubov authored Oct 23, 2024
2 parents da3686b + 58dd36e commit 3cbe844
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tagging-policies/audit-resource-tag-and-value-format.bicep
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/* audit-resource-tag-and-value-format.bicep
The purpose of this Azure Policy is to ensure that resources within a subscription have a specific tag with a specific value format.
This helps in maintaining governance, compliance, and organization of resources by enforcing tagging standards and ensuring that tag values adhere to a specified format.
*/

targetScope = 'subscription'

// Define the variables
var policyName = 'audit-resource-tag-and-value-format-pd'
var policyDisplayName = 'Audit a tag and its value format on resources'
var policyDescription = 'Audits existence of a tag and its value format. Does not apply to resource groups.'

// Define the policy
resource policy 'Microsoft.Authorization/policyDefinitions@2020-09-01' = {
name: policyName
properties: {
Expand Down Expand Up @@ -43,3 +51,6 @@ resource policy 'Microsoft.Authorization/policyDefinitions@2020-09-01' = {
}
}
}

// Define the output
output policyName string = policy.properties.displayName

0 comments on commit 3cbe844

Please sign in to comment.