{"record":{"id":"bf02f66cf024304e","repo":"oven-sh/bun","slug":"azure-unsupported-os-os","errorCode":null,"errorMessage":"[azure] Unsupported OS: ${os}","messagePattern":"\\[azure\\] Unsupported OS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/azure.mjs","lineNumber":444,"sourceCode":"function getBaseImageReference(os, arch) {\n  if (os === \"windows\") {\n    if (arch === \"aarch64\") {\n      return {\n        publisher: \"MicrosoftWindowsDesktop\",\n        offer: \"windows11preview-arm64\",\n        sku: \"win11-24h2-pro\",\n        version: \"latest\",\n      };\n    }\n    // Windows Server 2019 x64 — oldest supported version\n    return {\n      publisher: \"MicrosoftWindowsServer\",\n      offer: \"WindowsServer\",\n      sku: \"2019-datacenter-gensecond\",\n      version: \"latest\",\n    };\n  }\n  throw new Error(`[azure] Unsupported OS: ${os}`);\n}\n\nfunction getVmSize(arch) {\n  return arch === \"aarch64\" ? \"Standard_D4pds_v6\" : \"Standard_D4ds_v6\";\n}\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport const azure = {\n  get name() {\n    return \"azure\";\n  },\n\n  config,\n\n  /**","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/azure.mjs#L426-L462","documentation":"Thrown by getBaseImageReference() in scripts/azure.mjs when the Azure CI provider creates a VM whose `os` value is not the literal string \"windows\". The provider only knows Windows marketplace images (Windows 11 24H2 Pro arm64 via MicrosoftWindowsDesktop, Windows Server 2019 Datacenter x64 via MicrosoftWindowsServer), so any other OS string fails fast before Azure resources are provisioned.","triggerScenarios":"The azure provider is invoked with os set to anything except \"windows\" — e.g. \"linux\", \"macos\", \"windows-2022\", or a CI matrix entry whose os key was renamed or misspelled.","commonSituations":"Adding a new OS target to the CI matrix without extending getBaseImageReference (scripts/azure.mjs:426); renaming matrix keys (windows -> win); routing a Linux/macOS job to the Azure provider; typos in pipeline YAML variables.","solutions":["Set os to \"windows\" in the job config — it is the only supported value","Fix typos or renames in the CI matrix so the provider receives exactly \"windows\"","To support a new OS, add a branch in getBaseImageReference returning a publisher/offer/sku/version image reference for it"],"exampleFix":"// before\nfunction getBaseImageReference(os, arch) {\n  if (os === \"windows\") { /* ... */ }\n  throw new Error(`[azure] Unsupported OS: ${os}`);\n}\n\n// after — support windows-2025 as well\nif (os === \"windows\" || os === \"windows-2025\") {\n  return {\n    publisher: \"MicrosoftWindowsServer\",\n    offer: \"WindowsServer\",\n    sku: \"2025-datacenter-azure-edition\",\n    version: \"latest\",\n  };\n}","handlingStrategy":"validation","validationCode":"const SUPPORTED_OS = new Set([\"windows\"]);\nif (!SUPPORTED_OS.has(os)) {\n  console.error(`os \"${os}\" is not supported by the azure provider; supported: ${[...SUPPORTED_OS].join(\", \")}`);\n  process.exit(2);\n}","typeGuard":"const isAzureSupportedOs = (os) => os === \"windows\";","tryCatchPattern":null,"preventionTips":["Keep CI matrix os values in one shared constant alongside getBaseImageReference","Fail fast on unknown os before provisioning any Azure resources"],"tags":["azure","ci","configuration","vm"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}