Share via

Azure Blob Backup Vault: Policy not used

Benedikt Pittl 120 Reputation points
2026-04-20T19:40:51.23+00:00

I use Azure Backupvault to backup a blob storage account.

My Policy is attached.

Expected behaviour:

  • 1 year retention for restore points by default
  • 2 year retention for restore points each 4th sunday in month

Yesterday backup was running with a 2 year retention. Why?


{
    "properties": {
        "policyRules": [
            {
                "backupParameters": {
                    "backupType": "Discrete",
                    "objectType": "AzureBackupParams"
                },
                "trigger": {
                    "schedule": {
                        "repeatingTimeIntervals": [
                            "R/2026-03-08T17:00:00+00:00/P1W"
                        ],
                        "timeZone": "UTC"
                    },
                    "taggingCriteria": [
                        {
                            "tagInfo": {
                                "tagName": "Default",
                                "id": "Default_"
                            },
                            "taggingPriority": 99,
                            "isDefault": true
                        },
                        {
                            "tagInfo": {
                                "tagName": "monthly",
                                "id": "monthly_"
                            },
                            "taggingPriority": 15,
                            "isDefault": false,
                            "criteria": [
                                {
                                    "weeksOfTheMonth": [
                                        "Fourth"
                                    ],
                                    "daysOfTheWeek": [
                                        "Sunday"
                                    ],
                                    "objectType": "ScheduleBasedBackupCriteria"
                                }
                            ]
                        },
                        {
                            "tagInfo": {
                                "tagName": "weekly",
                                "id": "weekly_"
                            },
                            "taggingPriority": 20,
                            "isDefault": false,
                            "criteria": [
                                {
                                    "daysOfTheWeek": [
                                        "Sunday"
                                    ],
                                    "objectType": "ScheduleBasedBackupCriteria"
                                }
                            ]
                        }
                    ],
                    "objectType": "ScheduleBasedTriggerContext"
                },
                "dataStore": {
                    "dataStoreType": "VaultStore",
                    "objectType": "DataStoreInfoBase"
                },
                "name": "BackupIntervals",
                "objectType": "AzureBackupRule"
            },
            {
                "lifecycles": [
                    {
                        "deleteAfter": {
                            "objectType": "AbsoluteDeleteOption",
                            "duration": "P1Y"
                        },
                        "targetDataStoreCopySettings": [],
                        "sourceDataStore": {
                            "dataStoreType": "VaultStore",
                            "objectType": "DataStoreInfoBase"
                        }
                    }
                ],
                "isDefault": true,
                "name": "Default",
                "objectType": "AzureRetentionRule"
            },
            {
                "lifecycles": [
                    {
                        "deleteAfter": {
                            "objectType": "AbsoluteDeleteOption",
                            "duration": "P2Y"
                        },
                        "targetDataStoreCopySettings": [],
                        "sourceDataStore": {
                            "dataStoreType": "VaultStore",
                            "objectType": "DataStoreInfoBase"
                        }
                    }
                ],
                "isDefault": false,
                "name": "monthly",
                "objectType": "AzureRetentionRule"
            },
            {
                "lifecycles": [
                    {
                        "deleteAfter": {
                            "objectType": "AbsoluteDeleteOption",
                            "duration": "P1Y"
                        },
                        "targetDataStoreCopySettings": [],
                        "sourceDataStore": {
                            "dataStoreType": "VaultStore",
                            "objectType": "DataStoreInfoBase"
                        }
                    }
                ],
                "isDefault": false,
                "name": "weekly",
                "objectType": "AzureRetentionRule"
            }
        ],
        "datasourceTypes": [
            "Microsoft.Storage/storageAccounts/blobServices"
        ],
        "objectType": "BackupPolicy"
    },
    "id": "xx",
    "name": "yyy",
    "type": "Microsoft.DataProtection/backupVaults/backupPolicies"

Azure Backup
Azure Backup

An Azure backup service that provides built-in management at scale.

0 comments No comments

Answer accepted by question author

  1. Siva shunmugam Nadessin 9,625 Reputation points Microsoft External Staff Moderator
    2026-04-20T22:01:43.0733333+00:00

    Hello Benedikt Pittl,

    Thank you for reaching out to the Microsoft Q&A forum. 

    When investigated its isn’t a bug in the service – it’s your policy doing exactly what you told it to do. Here’s a quick breakdown of how your JSON is evaluated:

    1. You only ever run backups once a week (your schedule’s “P1W” interval), so backups only ever land on Sundays.
    2. On every execution the engine walks through your three taggingCriteria in priority order:
      • “monthly” (priority 15) if it’s the 4th Sunday
      • “weekly” (priority 20) if it’s any Sunday
      • “Default” (priority 99) if nothing else matches
    3. Whichever tag you land on then selects the matching retention rule:
      • monthly → 2 years
      • weekly → 1 year
      • Default → 1 year

    Because yesterday was in fact the 4th Sunday of the month, the “monthly” tag (and its 2 year retention) was applied. If you check a calendar you’ll see that is exactly the behavior you configured.

    If you’d rather:

    • Only ever get 1 year on Sundays except the 4th → no change needed, this is what just happened • Change which Sunday of the month gets the 2-year retention → edit the “weeksOfTheMonth” in your monthly criteria to First/Second/Last, etc. • Run backups on other days so your “Default” 1-year apply more often → add daily/other intervals to your schedule

    Reference docs:

    • Backup policy JSON schema (schedules + taggingCriteria):

     https://docs.microsoft.com/azure/backup/blob-backup-overview#configure-a-backup-policy

    • How schedule-based retention rules and priorities work: 

    https://docs.microsoft.com/azure/backup/blob-backup-configure-manage#schedule-and-retention-guidelines

    Let me know if you actually saw a 2 year retention on a non-4th Sunday or if you need help tweaking the schedule/criteria.


1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-20T19:41:11.79+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The backup ran with 2‑year retention because the backup instance for that run was tagged with the monthly tag, and the monthly tag is mapped to the monthly AzureRetentionRule, which has P2Y (2 years) as its deleteAfter duration.

    From the policy JSON:

    1. The trigger defines three tagging criteria:
      • Default (priority 99, isDefault: true)
      • monthly (priority 15)
      • weekly (priority 20)
    2. The monthly tagging criterion is:
         {
             "tagInfo": {
                 "tagName": "monthly",
                 "id": "monthly_"
             },
             "taggingPriority": 15,
             "isDefault": false,
             "criteria": [
                 {
                     "weeksOfTheMonth": [
                         "Fourth"
                     ],
                     "daysOfTheWeek": [
                         "Sunday"
                     ],
                     "objectType": "ScheduleBasedBackupCriteria"
                 }
             ]
         }
      
      This means: if a backup occurs on the fourth Sunday of the month, it is tagged as monthly.
    3. The retention rules then map tag names to lifecycles:
      • Default rule → P1Y (1 year)
      • monthly rule → P2Y (2 years)
      • weekly rule → P1Y (1 year)
    4. The schedule is:
         "repeatingTimeIntervals": [
             "R/2026-03-08T17:00:00+00:00/P1W"
         ]
      
      This is a weekly schedule on Sunday at 17:00 UTC. On any Sunday that is also the fourth Sunday of the month, the monthly criteria match, so that backup is tagged monthly and the monthly retention rule (2 years) is applied.

    So the observed behavior is expected: the run that happened “yesterday” fell on the fourth Sunday of that month, so the monthly tag was applied and the corresponding 2‑year retention rule was used.

    To get 1‑year retention on that run instead, remove or change the monthly tagging criteria (for example, change weeksOfTheMonth or daysOfTheWeek so it does not match that backup), or adjust the monthly retention rule’s deleteAfter duration.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.