Module 4: Governing the Snips Environment

Module 4Level 2Junior Azure Administrator

Governing the Snips Environment

Azure Policy and compliance·45 minutes

Azure Policy conceptsPolicy definitions and initiativesPolicy assignments and scopeCompliance and remediationResource locks: CanNotDelete and ReadOnly+3 more
The situation

The governance problem

Three weeks after the Azure environment went live, you receive a message from the Head of Digital & IT. A developer has created a virtual machine in North Europe. Another team has deployed resources with no tags and no identifiable owner. Last week, a test VM was accidentally deleted from the production resource group.

You need to put guardrails in place. Azure Policy will enforce the rules automatically, and resource locks will protect critical infrastructure from accidental deletion.

What you will learn

Azure Policy concepts
Policy definitions and initiatives
Policy assignments and scope
Compliance and remediation
Resource locks: CanNotDelete and ReadOnly
The Snips Cloud Baseline policy set
Enforcing permitted locations
Enforcing required tags

Azure Policy concepts

Policy definition

A rule that describes what is evaluated and what action to take. For example: deny resource creation outside UK South and UK West.

Initiative (policy set)

A collection of policy definitions grouped for a common purpose. The Snips Cloud Baseline initiative includes all governance policies.

Policy assignment

Applying a policy definition or initiative to a specific scope (management group, subscription or resource group).

Policy effects

What happens when a resource does not comply: Deny (block creation), Audit (log but allow), Append (add fields), Modify (change properties), DeployIfNotExists (deploy a remediation resource).

Compliance

Azure Policy continuously evaluates resources and reports compliance status. Non-compliant resources are flagged for remediation.

The Snips Cloud Baseline

The Snips Cloud Baseline is an initiative containing the following policies:

DenyAllowed locationsResources can only be created in UK South or UK West
DenyRequire Owner tagResources must have an Owner tag
DenyRequire Environment tagResources must have an Environment tag
DenyRequire Service tagResources must have a Service tag
DenyRequire CostCentre tagResources must have a CostCentre tag
AuditAudit unencrypted disksLog VMs with unencrypted OS disks

Interactive compliance dashboard

Review the Snips resources below. Identify which are non-compliant and why. Click a non-compliant resource to see the issue.

Compliantvm-contractors-prod-001
UK South
Non-compliantstorage-test-123
North Europe

Click to reveal the compliance issue

Non-compliantrg-paultest
UK South

Click to reveal the compliance issue

Compliantvnet-snips-prod-uks-001
UK South
Non-compliantvm-dev-eastus-001
East US

Click to reveal the compliance issue

Azure Policy with a Deny effect is applied at resource creation time. Existing non-compliant resources are not automatically deleted — they are flagged as non-compliant and you must remediate them manually or using a remediation task.

Azure CLI

Work with Azure Policy
# List all policy assignments in a subscription
az policy assignment list --output table

# Check compliance for a specific policy
az policy state list \
  --resource-group rg-contractors-prod-uks-001 \
  --output table

# Create a policy assignment to enforce UK South/West only
az policy assignment create \
  --name "snips-allowed-locations" \
  --display-name "Snips: Allowed locations" \
  --policy "e56962a6-4747-49cd-b67b-bf8b01975c4f" \
  --params '{"listOfAllowedLocations":{"value":["uksouth","ukwest"]}}' \\
  --scope "/subscriptions/<sub-id>"

Knowledge check

Five questions on Azure Policy and governance.

1.A team has deployed a virtual machine in North Europe, which is outside the Snips approved regions. Which Azure Policy effect would have prevented this?

2.You apply a CanNotDelete lock to the rg-network-prod-uks-001 resource group. What can users with Contributor access still do?

3.Snips has an Azure Policy initiative called 'Snips Cloud Baseline'. What is an initiative?

4.A resource is showing as Non-compliant in Azure Policy. What does this mean?

5.You need to apply a ReadOnly lock to a resource group. A colleague says this will prevent the team from working. Why might they be right?

Ready to mark this module complete?

Mark complete when you have read all sections, attempted the lab and completed the knowledge check.

AZ-104 objectives covered
  • Manage Azure identities and governance