---
cuppy_hub: azure
cuppy_path: reference/vm/scale-sets-and-images.md
cuppy_section: docs
cuppy_doc: XCT4-CT4S
cuppy_doc_uuid: e512d648-3cf9-4707-9896-92cc927412d5
cuppy_permalink: https://cuppy.io/azure/d/XCT4-CT4S
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/azure/docs/reference/vm/scale-sets-and-images
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: bd1dc7ef074e91a9366704320e914847eae8a7c4edeecf13a5dadb58410cbd68
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---


# VM scale sets and images

## Flexible or Uniform

**The orchestration mode is set at creation and can't be changed.** `az vmss create` defaults to **Flexible**, which Microsoft recommends.

| | Flexible | Uniform |
|---|---|---|
| Instances | Standard VMs (`Microsoft.Compute/virtualMachines`), managed with the normal VM APIs, extensions and boot diagnostics | Scale set child VMs, managed through the scale set VM APIs |
| Mixing | Different sizes, and Linux with Windows, in one set | Identical instances from one model |
| Default outbound internet | **No**: add a NAT gateway, load balancer outbound rules or public IPs (`reference/networking/outbound-connectivity.md`) | Yes (the implicit default, being retired) |
| Disks | Managed only | Managed and unmanaged |
| Instance count with fault-domain guarantees | 1,000 when the size supports memory-preserving updates or `platformFaultDomainCount = 1` (max spreading); 200 otherwise | 100 |
| Identity in `GET` | Only a reference to the identity | Identity, client ID and principal ID |

## Upgrades, health and repairs

| Upgrade policy | Behaviour | Fits |
|---|---|---|
| **Manual** (CLI default) | Model changes reach only new instances until you upgrade existing ones | You control timing |
| **Rolling** | Batches, with batch size, health thresholds, unhealthy-first ordering and zone ordering | Production. **On Flexible it requires the Application Health extension** |
| **Automatic** | No ordering guarantees: all instances may go down together | Dev/test; Service Fabric (only mode there) |

**Automatic instance repairs** replace (default), reimage or restart instances reported *Unhealthy* (or *Unknown* with rich health states) by the Application Health extension or a load balancer probe. They don't act on provisioning failures, block resource and subscription moves while enabled, and aren't supported on Service Fabric scale sets. Reimage and Restart need compute API 2021-11-01 or later.

## Azure Compute Gallery

A **gallery** holds **image definitions** (OS type and state, generation, security type, publisher/offer/SKU) and their **image versions** (`1.0.0`), each replicated to target regions.

```bicep
// Compute Gallery and a Gen2, Trusted Launch-capable Linux image definition
param location string = resourceGroup().location
param galleryName string = 'galPlatform'

resource gallery 'Microsoft.Compute/galleries@2025-03-03' = {
  name: galleryName
  location: location
  properties: {
    description: 'Golden images'
  }
}

resource ubuntuWeb 'Microsoft.Compute/galleries/images@2025-03-03' = {
  parent: gallery
  name: 'ubuntu-web'
  location: location
  properties: {
    osType: 'Linux'
    osState: 'Generalized' // Specialized images keep accounts and the computer name, and have no osProfile
    hyperVGeneration: 'V2'
    features: [
      {
        name: 'SecurityType'
        value: 'TrustedLaunchSupported'
      }
    ]
    identifier: {
      publisher: 'contoso'
      offer: 'web'
      sku: 'ubuntu-24_04'
    }
  }
}
```

- **From API 2025-03-03, new image definitions default to `hyperVGeneration: V2` and `SecurityType: TrustedLaunchSupported`.** The portal, CLI and PowerShell now create Trusted Launch VMs by default (`reference/vm/errors.md`); the hub's reading is that a Gen1 or unmarked definition is the likeliest reason a gallery image won't deploy that way. State both properties explicitly.
- **Generalized vs specialized:** generalized images have machine and user data removed (sysprep, `waagent -deprovision`). Specialized images boot faster but keep the source's accounts and **computer name**, and VMs from them have no `osProfile`, so `secrets` (Key Vault certificates, WinRM) don't work there.
- **Versions:** `az sig image-version create … --target-regions <r1> <r2> --replica-count <n>`. `--exclude-from-latest` keeps a version from being picked as `latest` while you test it; `--end-of-life-date`, `--block-deletion-before-end-of-life` and `--allow-replicated-location-deletion` protect against accidental deletion.
- **Replicas:** Microsoft suggests about one replica per 20 VMs created concurrently, and one per scale set created concurrently; overprovision rather than throttle. Images over 2 TB need **shallow replication** (up to 32 TB).
- **Not global:** a gallery lives in one region; keep two galleries in different regions for disaster recovery. Galleries, definitions and versions have per-subscription, per-region default limits that support can raise: read your usage before automating mass version creation.


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 107 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/azure/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
