Files
Prashant ChinnamandCopilot App 9ba96abc80 Add azure-postgresql-restore-deleted-server reference (#38)
Closes #37

## Summary

Adds an Azure reference for recovering a **deleted** Azure Database for
PostgreSQL Flexible Server. Until now that question routed to the HA/DR
reference, whose PITR guidance assumes the source server still exists.

## What's in the reference

- **Recovery window:** backups are kept for 5 days after deletion.
Recovery is best-effort, in the same subscription and original region
only.
- **Procedure:**
- Look up the `resourceId` and `submissionTimestamp` of the delete event
in the activity log.
- Call `Servers - Create Or Update` with `createMode: "ReviveDropped"`
and api-version `2025-08-01`, via `az rest`. There's no dedicated `az
postgres flexible-server` subcommand for this.
  - Prefer a new server name.
- The revive request needs user confirmation because it creates a
billable server.
- **VNet-integrated servers:** the request also needs
`network.delegatedSubnetResourceId` and
`network.privateDnsZoneArmResourceId`.
- **After the 5-day window:** restore from an Azure Backup vault if
long-term retention (LTR) was configured. The vault restores dump files
to a storage account, which you then load with `pg_restore`.
- **Post-restore checklist** for the new server.
- **Prevention:** a `CanNotDelete` lock. Locks don't block `DROP
DATABASE`.
- **HorizonDB:** deleted clusters can't be restored; recommend a Delete
lock.

## Other changes

- **Routing:** new row in `SKILL.md`, plus an entry in
`tests/.skills.json`.
- **Token budget:** `SKILL.md` was already at 3,991 of 4,000 tokens. I
compacted some wording (graph-workloads paragraph, a duplicate graph
bullet, one CLI-policy sentence) without removing any routing rules.
It's now exactly 4,000.
- **Tests:**
  - 3 activation-precision cases, including a gating negative.
  - 4 routing challenges (`route-del-01..03`, `route-hz-12`).
  - 5 eval challenges (`az-del-01..04`, `hz-del-01`).
- **Docs:** README catalog and counts, CONTRIBUTING counts, CHANGELOG.

## Validation

- `python -m pytest tests -m "not pg and not integration and not
azure"`: 187 passed.
- `tests/evals/routing_eval.py --check`: PASS. All new challenges route
correctly on copilot-cli, claude-code and codex-cli.
- `tests/evals/lint_challenges.py`: 331 challenges, no schema issues.

## Sources

- [Restore a deleted
server](https://learn.microsoft.com/azure/postgresql/backup-restore/how-to-restore-deleted-server)
- [Servers - Create Or Update
(2025-08-01)](https://learn.microsoft.com/rest/api/postgresql/servers/create-or-update?view=rest-postgresql-2025-08-01)
- [Resource
locks](https://learn.microsoft.com/azure/postgresql/configure-maintain/how-to-enable-deletion-protection)
- [HorizonDB business
continuity](https://learn.microsoft.com/azure/horizondb/backup-restore/concepts-business-continuity)

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-01 14:47:17 -05:00
..