Add scaling status endpoints and documentation for cpu-app SRE operations#103
Draft
Add scaling status endpoints and documentation for cpu-app SRE operations#103
Conversation
Co-authored-by: mrsharm <68247673+mrsharm@users.noreply.github.com>
Co-authored-by: mrsharm <68247673+mrsharm@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Scale-down operation for cpu-app: Already at minimum instance count
Add scaling status endpoints and documentation for cpu-app SRE operations
Aug 19, 2025
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.
This PR addresses the SRE agent issue where scale-down operations fail because the cpu-app is already at minimum instance count. The solution provides clear API endpoints and comprehensive documentation to help SRE automation systems understand when scale-down failures are expected behavior rather than actual errors.
Problem
The SRE agent was reporting scale-down operation failures for cpu-app with the message "Already at minimum instance count (1)". This was being treated as an error, but it's actually expected behavior for Azure App Service Free tier (F1) which:
Solution
New API Endpoints
Added two new endpoints specifically designed for operational monitoring:
Health Endpoint (

GET /api/app/health)Returns general application health with basic scaling information including current instances, tier limitations, and scaling capabilities.
Scaling Status Endpoint (

GET /api/app/scaling-status)Returns detailed scaling information specifically for SRE automation systems, including:
scaleDownPossibleandscaleUpPossible"statusForSRE": "EXPECTED_STATE_NO_ACTION_NEEDED"Infrastructure Updates
Enhanced the Bicep template (
main.bicep) with:Documentation
Created comprehensive operational documentation (
SCALING-INFO.md) that includes:Benefits for SRE Operations
/api/app/scaling-statusbefore attempting scaling operationsstatusForSREfield enables automation to handle expected statesExample Usage
This change transforms the reported "failure" into properly documented expected behavior, enabling SRE systems to make informed decisions about scaling operations.
Fixes #102.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.msbicep build main.bicep(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.