Skip to content

Add autoscaling and logging config to web app Bicep template#42

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-bicep-template-web-app
Draft

Add autoscaling and logging config to web app Bicep template#42
Copilot wants to merge 2 commits into
mainfrom
copilot/add-bicep-template-web-app

Conversation

Copilot AI commented Feb 26, 2026

Copy link
Copy Markdown

Motivation and Context

The existing main.bicep deployed the web API App Service without HTTP/application logging enabled or any autoscale policy, leaving production workloads without observability defaults and no capacity elasticity.

Description

New parameters

  • autoscaleMinCapacity (default: 1) — minimum instance floor
  • autoscaleMaxCapacity (default: 10) — maximum instance ceiling
  • autoscaleDefaultCapacity (default: 1) — baseline count used when no rule fires

New variable

  • supportsAutoscale = webAppServiceSku != 'B1' — gates the autoscale resource; B1 does not support scaling

appServiceWebLogs (Microsoft.Web/sites/configlogs)

  • Application logs to filesystem at Warning level
  • HTTP logs: enabled, 7-day retention, 35 MB cap
  • Detailed error messages + failed-request tracing enabled

webAppScaleSettings (Microsoft.Insights/autoscalesettings, deployed only when supportsAutoscale)
Targets appServicePlan with a single CPU-based profile:

Rule Metric Threshold Window Action Cooldown
Scale out CpuPercentage (avg) > 70% 10 min +1 instance 10 min
Scale in CpuPercentage (avg) < 25% 10 min −1 instance 10 min

Contribution Checklist

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.ms
    • Triggering command: /usr/local/bin/bicep bicep build /home/REDACTED/work/chat-copilot/chat-copilot/scripts/deploy/main.bicep (dns block)
  • azcliprod.blob.core.windows.net
    • Triggering command: /usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli bicep version (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@HassanFad

Copy link
Copy Markdown
Owner

great work done

@HassanFad

Copy link
Copy Markdown
Owner

Well done GH Copilot

@HassanFad HassanFad requested a review from Copilot February 26, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: HassanFad <4920663+HassanFad@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Bicep template for web app deployment with autoscaling Add autoscaling and logging config to web app Bicep template Feb 26, 2026
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.

3 participants