Skip to content

Add automatic scaling support for Azure App Service Environment#12545

Closed
Copilot wants to merge 3 commits intorelease/13.0from
copilot/port-pull-request-12305
Closed

Add automatic scaling support for Azure App Service Environment#12545
Copilot wants to merge 3 commits intorelease/13.0from
copilot/port-pull-request-12305

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Ports #12305 to enable automatic scaling for Azure App Service Plans.

Changes

  • Resource model: Added EnableAutomaticScaling internal property to AzureAppServiceEnvironmentResource

  • Infrastructure generation: Modified AppServicePlan provisioning to configure scaling behavior based on flag:

    • elasticScaleEnabled: true / perSiteScaling: false when automatic scaling enabled
    • elasticScaleEnabled: false / perSiteScaling: true otherwise
    • maximumElasticWorkerCount: 10 (follows Azure best practices)
  • Dashboard configuration: Set scale limits to 1 for dashboard app service:

    • FunctionAppScaleLimit: 1
    • ElasticWebAppScaleLimit: 1
  • API: Added WithAutomaticScaling() extension method for opt-in

Usage

var appServiceEnv = builder.AddAzureAppServiceEnvironment("env")
    .WithAutomaticScaling();

Feature is opt-in (disabled by default). Automatic scaling improves performance and avoids cold starts per Azure Well-Architected Framework guidance.

Original prompt

Port #12305 to this branch


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 31, 2025 03:55
- Added EnableAutomaticScaling property to AzureAppServiceEnvironmentResource
- Updated AppServicePlan to configure elasticScaleEnabled, perSiteScaling, and maximumElasticWorkerCount based on EnableAutomaticScaling flag
- Added WithAutomaticScaling() extension method to enable automatic scaling
- Updated dashboard configuration to set FunctionAppScaleLimit and ElasticWebAppScaleLimit to 1
- Updated XML documentation for WithDashboard method
- Added test for automatic scaling feature
- Updated all existing snapshot test files with new properties

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copilot AI changed the title [WIP] Port pull request 12305 to new branch Add automatic scaling support for Azure App Service Environment Oct 31, 2025
Copilot AI requested a review from davidfowl October 31, 2025 03:59
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12545

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12545"

@ShilpiRach
Copy link
Contributor

PLEASE DONT MERGE - found a blocking bug that causes issues with telemetry being routed to dashboard after worker restart

@davidfowl davidfowl closed this Nov 6, 2025
@davidfowl
Copy link
Member

@ShilpiRach what's the state of this? The bug is still in main.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2025
@sebastienros sebastienros deleted the copilot/port-pull-request-12305 branch January 15, 2026 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants