Configuring Azure autoscaling (VM Scale Sets)

Peak loads and seasonal demand spikes make a service either sit idle or crash at the worst possible moment. We set up Azure autoscaling turnkey: rules, schedules, and forecasting for your load profile. Response to traffic growth accelerates many times over, and manual intervention during peaks is removed from operations.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Azure Autoscaling: What Breaks Without It

Peak load rarely arrives on schedule. Traffic spikes after a newsletter, media publication, or seasonal promotion — and in the first minutes the service receives many times more requests than were planned for capacity.

When nodes are added manually, the on-call engineer learns about the problem from a spike in errors on a graph, not before it.

Then a failure chain kicks in. The queue of incoming requests grows faster than new nodes are created; response time exceeds the maximum wait of client applications, some requests fail with an error, and retries finish off the remaining nodes.

This is already service degradation that the user sees, not an abstract lack of resources in a report.

Manual capacity management is bad because it works reactively, not predictively. While the on-call engineer assesses the scale, brings up nodes, and waits for them to become ready, the peak has already passed — and the next wave requires the same manual actions.

The opposite extreme is no less harmful: keeping a reserve for the maximum peak around the clock means maintaining idle capacity.

Autoscaling in Azure closes exactly this gap: rules react to load metrics before failures become widespread, add nodes for growth, and remove excess ones when traffic returns to normal.

Below we break down how this is closed in practice — from choosing metrics to protecting against false triggers.

What Changes in Service Operation: Reaction Speed and Resilience

Managed scaling should be evaluated not by the fact that "instances are added" but by four values visible in monitoring. We take them before implementation and repeat the measurement after — then the result is compared in numbers, not feelings.

What we check Benchmark How we measure
Reaction time to load new instances in operation within minutes rule trigger timestamp vs node readiness timestamp
Failure rate at peak does not rise above baseline ratio of error responses to total requests in the peak window
Recovery time after failure return to normal within one or two health check cycles health check log and node replacement history
Resource utilization outside peaks baseline level instead of a constant reserve for maximum average daily utilization and night windows separately

In Azure, these values are captured by built-in tools: scaling rules rely on node metrics and queue length, while health checks themselves mark an unhealthy instance and remove it from load balancing.

Separately, we check that the rule does not "jitter" at the threshold boundary — otherwise the number of nodes grows, but useful work does not change, and the idle reserve remains.

The list is short, but behind each line is a specific decision: startup delay, trigger threshold, number of scale-out steps, behavior during rollback.

After launch, this same list becomes a report with before-and-after measurements — it shows where the service stopped hitting the ceiling and where there is still headroom.

Autoscaling Modes: Rules, Schedule, Forecast

In VM Scale Sets, scaling profiles are not mutually exclusive: a single configuration can maintain a calendar window, metric-based rules, and a predictive scenario at the same time.

The choice here is not either/or — it is important to understand which mode covers the main load scenario and which ones insure it at the edges.

How the Modes Differ in Practice

Mode When it fits Limitations
Metric-based rules Load is spiky and does not fit a calendar well; reaction to actual state is needed Threshold values and reaction inertia are selected manually: while the metric averages and the cooldown elapses, several minutes pass; at the threshold boundary itself, instances "jitter"
Schedule Peak windows are known in advance: business hours, reporting periods, regional time zones, promotions Does not notice unplanned spikes and drops; when the load profile changes, windows have to be revised
Predictive scenarios Steady traffic with a daily and weekly cycle, when capacity needs to be prepared in advance Requires accumulated metric history and time to train the model; on anomalies and one-off events the forecast is wrong, so it is insured by rules

The working scheme is more often combined: the forecast raises capacity in advance, rules cover the residual deviation, and the schedule fixes a guaranteed minimum for planned peaks.

The asymmetry is also intentional — we scale out quickly, scale in cautiously and with a long pause: removing an extra instance is safer than failing to keep up with load.

Implementation Procedure: From Metric Collection to Handover of Operational Rules

Work proceeds in stages, and each is closed with a verifiable artifact — a diagram, configuration, or report. That is why errors in scaling rules are found during load testing, not at the moment of a production peak. The implementation procedure for Azure autoscaling looks like this.

  1. Audit of the current scheme. We analyze which metrics are already collected, how traffic is distributed, where application state is stored, and whether there are shared resources that do not scale together with nodes.
  2. Rule design. We define the set of metrics, trigger thresholds, step for adding and removing capacity, lower and upper bounds, and the pause between actions — so the set does not "jitter."
  3. Metric collection setup. We connect node and application metrics, logs, and alerts, and record the baseline of normal load — without it, a threshold cannot be considered justified.
  4. Configuration assembly. We describe the set template, node deployment order, automatic registration behind the load balancer, and application readiness check before accepting traffic.
  5. Load testing. We run the load profile: capacity must be added based on the right metric, and we measure the time to reach the new volume, behavior when a node fails, and return to minimum.
  6. Handover of operational rules. We provide operating instructions: how to read metrics, when to change thresholds, what to do on a false trigger, and how to roll back a rule. After that, the operations team changes settings on its own.

Rule Sets, Infrastructure Diagrams, and Operational Procedures

After implementing autoscaling, the team is left not with a configured environment but with a set of artifacts that the system is operated by and handed over to another shift without us.

Everything is stored in the repository next to the configuration: rules live in code, changes go through review, and edit history is preserved.

  • Infrastructure diagrams. Diagrams of connections between the load balancer, scale set, network segments, and storages, plus an explanation of where the bottlenecks are.
  • Rule sets. For each set: trigger metrics, thresholds, averaging window, reaction delay, lower and upper bounds on the number of nodes — with justification for the chosen values.
  • Access separation. Roles and groups: who changes rules, who only reads metrics, who starts manual scaling. Access is granted to groups, not individuals.
  • Instructions for the on-call shift. What to do when an alert triggers, how to check the state of the set, how to roll back an unsuccessful change, and whom to escalate to.
  • Operational procedure. Procedure for planned changes, maintenance windows, frequency of threshold review, and approval of edits.
  • Rollback and verification scenarios. Step-by-step actions during degradation and the procedure for verifying that rules trigger under real load, not only in theory.

The set removes dependence on specific people: a new engineer joins on-call using the documents, not chat messages.

Case Study: How Service Resilience Grew Under Peak Loads

A service with pronounced peaks: reporting periods and marketing campaigns produced a tenfold increase in requests within minutes, while between them load fell almost to zero. Capacity, however, was chosen for the worst case — half the machines were idle most of the month.

How It Was Before the Changes

The VM fleet was fixed. Nodes were added manually based on an alert: from signal to a machine ready to accept traffic took 40–60 minutes — the peak managed to end before help arrived.

In such windows the service returned 5–7% errors, and the request queue grew faster than it could be processed. Planned maintenance also went through downtime: a total of about two hours of unavailability per month and nighttime on-call shifts for engineers.

What Was Changed and What We Got

The service was migrated to Azure Virtual Machine Scale Sets with autoscaling based on three signals: CPU utilization, request queue length, and number of active connections.

Node scale-out was configured aggressively — several machines per step, scale-in conservatively and with a cooldown period, so the group would not "jitter" on short spikes.

Health checks remove an unhealthy node from load balancing and replace it automatically, while image updates proceed node by node without service downtime.

Reaction to the peak was reduced to 2–3 minutes instead of 40–60, the error rate in peak windows fell below 0.5%, and downtime went from two hours per month to a few minutes per quarter.

The number of machines outside peaks was halved: capacity now follows load, not the worst-case scenario.

What to Do If Some Services Already Run on Their Own Servers?

Own servers rarely go away entirely: they still host databases, message brokers, licensed software, and everything tied to specific hardware or an isolated environment.

The task is not to move everything to the cloud, but to make cloud nodes and own machines work as a single pool of capacity.

Unified capacity is calculated not by the load of individual machines, but by a common metric — queue length, service response time, or number of active sessions.

Such a signal is collected by the load balancer or monitoring system, and it becomes the single decision point: while own servers cope, new cloud nodes are not brought up.

Manual management remains where a node stores state: DBMS, file storages, brokers. Such a machine cannot be added based on a metric — first replication, then putting it into operation. For them, automation only signals a shortage, and an engineer makes the decision.

The main source of failures in mixed infrastructure is rule conflict: cloud automation and scripts on own servers react to the same signal, and the system goes into oscillation, either removing or returning nodes.

A single decision owner and a smoothing window help — the reaction occurs after the indicator has held for a specified time.

Rules are described declaratively, with a single set of thresholds for all sites.

The documentation records what is scaled automatically, what remains under manual management, and by which signal the decision is made — otherwise the mixed scheme will again spread into uncoordinated pieces.

Technical Concerns: Metrics, Warm-Up, and Configuration Rollback

Autoscaling rules are verified not on a graph but on behavior under load.

The utilization metric arrives over an averaging window, so the decision to add an instance always lags slightly behind the spike — and this is not a configuration defect but a property of any system operating on observed indicators. The engineer's task is not to remove the lag but to ensure it does not affect the user.

We analyze typical concerns that arise when handing over such a setup.

The metric arrives with a delay — will the site have time to go down?

The delay consists of the polling interval and the cooldown period, which prevents the rule from "jittering" on every fluctuation.

We configure the averaging window based on the trend, not the peak value, and keep the target utilization level with headroom — the rule adds instances before the request queue starts to grow.

For predictable peaks known in advance, a schedule is added: the required number of instances is brought up before the load arrives.

What happens to active connections when an instance is removed?

The instance is first removed from load balancing, then given time to finish current requests — only after that is it shut down.

For long-lived sessions and streaming data delivery, rules are built separately: scale-in is based on the connection counter rather than CPU utilization, and the minimum number of instances is fixed so that removal does not interrupt operation entirely.

How do I roll back an unsuccessful rule without dismantling the setup manually?

The scaling configuration is stored in the repository together with the rest of the infrastructure, so rollback is returning to the previous revision and reapplying it.

Additionally, an upper growth limit is set: even with an erroneous rule, the setup will not go to hundreds of instances. The lower limit protects against the opposite — complete removal of capacity if a metric fails.

Let's Discuss the Task and Come Back with an Implementation Plan

To make the assessment substantive, start by describing the task. Anything you already have on hand will work: the current environment configuration and load profile for a week and a month — they show where autoscaling will work and where it will hit a bottleneck. We will review this before the call so the meeting is about solutions, not requirements gathering.

What helps obtain an accurate assessment and scope of work:

  • load profile: average and peak utilization, daily and weekly fluctuations, seasonality;
  • current scheme: how many instances run constantly, how they are updated, what balances traffic;
  • metrics currently used to decide on scaling: CPU utilization, queue length, number of requests;
  • bottlenecks: database, cache, external services that do not grow with the application;
  • availability requirements and acceptable time while an instance is brought into or taken out of operation;
  • constraints: network rules, subscription quotas, access provisioning procedure, who approves changes.

On the call we will cover three things: which metrics to scale by, how quickly to react to a peak, and how to safely return to the baseline number of instances.

After that, we will come back with an implementation plan — scope of work by stages, a set of rules and thresholds, a verification scheme, and rollback points. Describe the task — we will come with an assessment and a plan.