L4.4 β€” Enterprise Data Protection Strategy 🟣

πŸ“ Level 4 Β· Protect Β· Chapter 4 of 4 Β Β·Β  Previous: L4.3 β€” Operational Backup Management Β Β·Β  Next: πŸ—ΊοΈ Curriculum Map


Goal: turn per-resource backup into a policy with a defensible price. The new long-retention policy tiers its own tail into archive, and the arithmetic justifies every year of it.

The IaC lesson: a retention policy is a financial commitment expressed as parameters β€” with the rates written as comments beside them, one code review checks the arithmetic and the implementation in the same diff.


Who this is for Time You need first Cost while it runs
Chapter 4 of Level 4 · everyone ~20 min L4.1 and L4.3 🟣 ~$0.01/hr added · ~$2.10/hr running total, and growing

[!WARNING] Level 4 is the only level whose cost keeps rising with nothing changed. Retained recovery points accumulate β€” a 7-year yearly policy is a bill that grows every January. Price it here, on a lab database, before agreeing to it.


What you’re building

A second backup policy lands beside the daily one L4.1 created β€” the same additive, never-edit-what-another-template-owns pattern L2.1 used. It carries the compliance retention shape, plus the tiering rule that keeps that shape affordable by moving the long tail into the archive tier.

flowchart LR
  VAULT["rsv-iacdemo-backup<br/>from L4.1"]
  P1["bkpol-iacdemo-daily<br/>L4.1 Β· 30 days"]
  P2["bkpol-iacdemo-longterm<br/>30 daily Β· 12 monthly Β· 7 yearly"]
  ARCH["archive tier after 6 months<br/>$0.0027/GB/month<br/>vs $0.0224 standard"]
  FROZEN["redundancy + cross-region restore<br/>decided in L4.1 Β· cannot change"]
  POL["Azure Policy audit<br/>off β€” needs Resource Policy Contributor"]

  P1 --> VAULT
  P2 --> VAULT
  P2 --> ARCH
  FROZEN -. "already fixed" .-> VAULT
  POL -. "same wall as L2.4" .-> VAULT

  classDef v fill:#f5eefc,stroke:#7c4dbe,color:#1a1a1a
  classDef save fill:#eefaf0,stroke:#3a9d5d,color:#1a1a1a
  classDef no fill:#fdecea,stroke:#c0392b,color:#1a1a1a
  class VAULT,P1,P2 v
  class ARCH save
  class FROZEN,POL no

Text description of this diagram</summary>

A second backup policy alongside the daily one L4.1 created β€” added as a child of the vault, the same additive pattern L2.1 used for diagnostic settings, never by editing the vault another template owns.

The new policy carries the compliance shape: 30 daily, 12 monthly, and 7 yearly recovery points. The green box is the lever that makes that affordable β€” a tiering rule moves everything older than six months into the archive tier at $0.0027/GB/month against $0.0224 standard, roughly an 88% cut on the long tail without shortening the retention promise. That is why archiving beats trimming retention as a first move.

The two red boxes are things this chapter deliberately cannot do. Redundancy and cross-region restore were frozen when L4.1 protected its first item. And the governance policy assignment hits the same wall as L2.4: Contributor cannot create one.

</details>

Source: curriculum/L4.4-data-protection-strategy/main.bicep Β· main.bicepparam


πŸ” Going deeper β€” immutability, and why this template does not set it</summary>


Immutability is not set here, and that is deliberate. Vault immutability belongs to L4.1, and its Locked state cannot be undone by anyone, including Microsoft support. That is the entire point of it β€” an attacker with full admin rights still cannot shorten your retention. It is also exactly why no template should set it as a convenience. Decide it consciously, in L4.1, with someone else reading the pull request.

</details>

πŸ” Going deeper β€” the permissions this needs</summary>

Azure RBAC β€” the minimum this chapter needs

Contributor on the lab resource group for the policy. Resource Policy Contributor or Owner only if you enable the governance audit.
Why: a backup policy is a child of the vault, so ordinary rights are enough. The audit policy assignment is off by default for the same reason as L2.4 β€” Microsoft.Authorization/*/Write is in Contributor notActions, so a policy assignment fails for the audience this lab is written for. Locking immutability, if you ever do, needs Owner and should need a conversation.
Microsoft Entra ID roles

None.
Data protection strategy is Azure-plane. The directory equivalent β€” deciding who may approve a retention reduction, and proving it later β€” lives in Microsoft Entra ID governance: PIM for the backup admin role, and access reviews on whoever holds it. Neither is in scope here, and both belong in the same document as this policy.

For more info β€” Immutable vaults, and what Locked really means

</details>



[!NOTE] 🏫 Classroom: use the GitHub Actions option. Your Azure account holds Reader, so local az deployment commands will be refused β€” deploys go through your fork’s workflow, which uses the workshop deploy identity automatically. Compiling locally (az bicep build) works for everyone.

πŸš€ Deploy it β€” pick any one of three ways



1 Β· Bicep CLI
Copy-paste in the terminal


2 Β· GitHub Actions
One button in the browser


3 Β· GitHub Copilot
Ask AI in plain English



Β  Option 1 Β· Bicep from the terminal

az deployment group what-if --resource-group $env:AZURE_RESOURCE_GROUP --parameters curriculum/L4.4-data-protection-strategy/main.bicepparam
az deployment group create  --resource-group $env:AZURE_RESOURCE_GROUP --parameters curriculum/L4.4-data-protection-strategy/main.bicepparam

You should see: retentionShape describing the policy in plain terms, archiveSaving quantifying the tiering lever, and whatL41Froze reminding you which decisions are already closed.

Model the expensive line before you accept it:

$env:CURRICULUM_YEARLY_RETENTION = "0"    # then compare the storage forecast against 7



Β  Option 2 Β· GitHub Actions (push-button)

Actions β†’ β€œCurriculum L4 - Backup & Recovery Readiness” β†’ Run workflow β†’ L4.4 - Enterprise Data Protection Strategy.

Worth one Stop after what-if run: adding a second policy is harmless, but seeing the diff before it lands is the habit this whole level is trying to build.



Β  Option 3 Β· GitHub Copilot (plain English)

Load your values first: ./scripts/Load-LabSettings.ps1. Then in Copilot Chat β†’ Agent mode:

Deploy curriculum/L4.4-data-protection-strategy/main.bicep to my lab resource group ($env:AZURE_RESOURCE_GROUP) with az deployment group create.

Then get it to do the arithmetic you would otherwise skip:

Using the rates in the comments of curriculum/L4.4-data-protection-strategy/main.bicep, calculate the monthly backup storage cost for four 30 GB VMs under this policy after one year and after seven, with and without archive tiering. Show the working.

The gap between those four numbers is the business case for tiering, and it is the slide that ends this level. Sanity-check the rates against the Curriculum Cost Model before you quote them to anyone.



βœ… Verify it

  1. Both policies exist side by side:

    az backup policy list --vault-name "rsv-$env:AZURE_PREFIX-backup" -g $env:AZURE_RESOURCE_GROUP `
      --query "[].{name:name, type:properties.backupManagementType}" -o table
    

    You should see: the daily policy from L4.1 and the long-term one from here. Nothing was replaced β€” move a single item onto the new policy and leave the rest, so you can compare.

  2. The tiering rule is really there:

    az backup policy show --vault-name "rsv-$env:AZURE_PREFIX-backup" -g $env:AZURE_RESOURCE_GROUP `
      -n "bkpol-$env:AZURE_PREFIX-longterm" --query "properties.tieringPolicy" -o json
    

    You should see: TierAfter at 6 months. Archive tiering has a minimum retention requirement, so a policy that keeps recovery points for less than that cannot use it β€” another case where the platform constrains the design.

  3. Confirm what L4.1 closed off:

    az backup vault backup-properties show -n "rsv-$env:AZURE_PREFIX-backup" -g $env:AZURE_RESOURCE_GROUP `
      --query "{redundancy:storageModelType, crossRegionRestore:crossRegionRestoreFlag}" -o table
    

    You should see: whatever L4.1 chose. If cross-region restore is false and your strategy needs it, the honest answer is that this vault cannot deliver it β€” and rebuilding a vault means re-protecting everything and losing the recovery point history. That consequence is the reason L4.1 asked first.

  4. Write the strategy down. You now have retention shapes, redundancy, a tiering rule, alerting from L4.3 and a restore drill result. Produce a one-page data protection standard with a dollar figure per line and an RPO and RTO per tier. That document, not the deployment, is the output of Level 4 β€” and the numbers in it are defensible because you measured them.


GitHub feature spotlight Β· The cost model and the code in one review

You just used it: retention, redundancy and tiering are all parameters in one file, and the rates that price them are comments beside them. A reviewer can check the arithmetic and the implementation in the same diff. Find it: the archiveSaving and theWholeFormula outputs β€” the template states its own cost model rather than leaving it in a spreadsheet nobody versions. Beyond the lab: a retention policy is a financial commitment with a code review attached. Treat it like one. Docs β†’



➑️ What carries forward

Level 4 is complete: the estate is protected, monitored, rehearsed and costed. Level 5 puts Microsoft Sentinel on the workspace L3.3 started filling β€” and needs a Microsoft Entra ID role for the first time. Level 6 protects against losing a region rather than losing data.


🧭 Where next?

Your situation Go to
β¬… Back to the main path πŸ—ΊοΈ Curriculum Map
Ready to keep going β€” put Sentinel on the workspace Level 5 Β· Detect
Not interested in Sentinel? Level 6 only needs Levels 1–4 β€” skip straight to resilience Level 6 Β· Recover
Done for the day β€” the estate bills while idle Cleanup & Reset
Something didn’t work Troubleshooting