Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add policy ensuring that tag values adhere to a specified format #181

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading