Repository navigation
Cut Azure costs: uptime check off, delete old registry images after deploys - #64
Merged
Merged
Conversation
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBixe8vfgVXDMVRMicQbiC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdexplains 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.shkeeps 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:
DRY_RUN=1lists what it would delete without deleting.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