Skip to content

Cut Azure costs: uptime check off, delete old registry images after deploys - #64

Merged
rrice-dev merged 3 commits into
mainfrom
monitoring-cost
Oct 29, 2026
Merged

rrice-dev merged 3 commits into
mainfrom
monitoring-cost

Conversation

@rrice-dev

@rrice-dev rrice-dev commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Cuts Azure costs. Changes the deploy and the docs; no app code.

Uptime check off. The availability test is turned off in Azure to save money. docs/monitoring.md explains why and gives the one command to turn it back on. When it is on, it now checks from one region every 15 minutes, not three regions every 5.

Old registry images deleted after each deploy. scripts/prune-images.sh keeps the newest 10 images of each app, plus whatever each app is running, and deletes the rest, so the registry stays within the 10 GB its Basic plan includes. The deploy runs it after the live-site check passes, and a failure there does not fail the deploy.

Safety:

  • It deletes whole manifests by digest, never by tag. Deleting by tag would also remove any kept tag pointing to the same image.
  • It keeps the inner manifests (image and build record) of kept images.
  • It stops without deleting anything if any lookup fails.
  • DRY_RUN=1 lists what it would delete without deleting.
  • It was tested against a simulated registry with nested, shared and rolled-back images.

Before merging: the deploy identity needs the AcrDelete role on the registry, and a dry run should be checked first. See the conversation for the commands.

https://claude.ai/code/session_01EBixe8vfgVXDMVRMicQbiC


Generated by Claude Code

rrice-dev and others added 2 commits October 29, 2026 12:32
The availability test was most of the Azure bill: 864 billed checks a day
from three regions, and frequent enough that the apps never scaled to zero.
The live test and the "Site is down" alert were changed to one region
(Chicago) every 15 minutes on Oct 29; this updates the guide to match and
explains the trade-off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBixe8vfgVXDMVRMicQbiC
- scripts/prune-images.sh keeps the newest 10 images of each app, plus
  whatever each app is running, and deletes the rest. It deletes whole
  manifests by digest (never by tag, which could take a kept tag with it),
  keeps the inner manifests of kept images, and stops without deleting if
  any lookup fails. DRY_RUN=1 shows what it would delete. Tested against a
  simulated registry with nested, shared and rolled-back images.
- The deploy runs it after the live site check; a failure there doesn't
  fail the deploy.
- docs/monitoring.md: the availability test is now turned off to save
  money, with the command to turn it back on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBixe8vfgVXDMVRMicQbiC
@rrice-dev rrice-dev changed the title Monitoring guide: uptime check from one region every 15 minutes Cut Azure costs: uptime check off, delete old registry images after deploys Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBixe8vfgVXDMVRMicQbiC
@rrice-dev
rrice-dev merged commit 091810b into main Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant