# FLUX retirements on Azure Foundry: move image calls without a rewrite

URL: https://infro.io/blog/flux-retirements-on-azure-foundry-move-image-calls-without-a-rewrite
Author: INFRO Editorial (https://infro.io/blog/editorial)
Publisher: INFRO
Published: 2026-11-15
Last modified: 2026-11-15
Last reviewed: 2026-11-15 (next review due 2026-12-15)
Topic: Architecture and migration
Format: Guide

> FLUX-1.1-pro and FLUX.1-Kontext-pro retire on Azure Foundry on 2027-01-05, FLUX.2-flex and FLUX.2-pro on 2027-01-20, with no replacement listed.[^azure-retirement-schedule] Keep one internal request shape, write a small adapter per backend, and shift traffic with a weighted canary rather than editing every call site.

Key takeaways:
- Azure Foundry retires FLUX-1.1-pro and FLUX.1-Kontext-pro on 2027-01-05 and FLUX.2-flex and FLUX.2-pro on 2027-01-20; the schedule lists no replacement for any of them.
- Foundry serves FLUX.2 only through the BFL-specific API and FLUX-1.1-pro and Kontext through an OpenAI-style Image API, so you may have two request shapes to unify, not one.
- Put one internal request shape in front of image calls and translate it per backend; the migration then touches an adapter and a config value, not every call site.
- Do not expect the same pixels from the same seed on another backend: compare size, format, reference-image handling and moderation behavior, then score output with a frozen prompt set.
- Canary with weighted traffic, keep the old deployment as a standby until the retirement date, and remember Microsoft says retirement dates are not extendable.

## What retires, and when

Microsoft's Foundry retirement schedule lists four Black Forest Labs models, all at the GA stage, with a retirement date and no replacement named.[1]

| Model | Retirement date | Days from 2026-11-15 | Replacement listed |
| --- | --- | --- | --- |
| FLUX-1.1-pro | 2027-01-05 | 51 | none |
| FLUX.1-Kontext-pro | 2027-01-05 | 51 | none |
| FLUX.2-flex | 2027-01-20 | 66 | none |
| FLUX.2-pro | 2027-01-20 | 66 | none |

Table: Retirement dates from the Foundry retirement schedule, page last updated 2026-09-23.

Three facts from the lifecycle policy shape the plan. Retired models return `410 Gone` on every inference request.[2] Microsoft picks an official replacement roughly 90–120 days before retirement, and where it names one that is also the auto-upgrade target;[2] for FLUX, none is listed, so assume nothing upgrades for you. And the migration guidance states that retirement dates are not extendable and there is no exception process.[3]

Re-read the schedule before you commit to a target. It is a living page, and a replacement may appear after the date on which this article was checked.

## Two request shapes may be in your codebase

Foundry exposes FLUX through two routes, and which one your code uses depends on the model.[4]

- The **BFL provider-specific API** supports all four models and accepts extra parameters: `guidance`, `steps`, `seed`, `aspect_ratio`, `safety_tolerance` and `output_format`. Its URL path uses a model path (`flux-2-pro`, `flux-2-flex`, `flux-kontext-pro`, `flux-pro-1.1`) that is not identical to the model id.
- The **Image API** is an OpenAI-compatible endpoint available only for FLUX.1-Kontext-pro and FLUX-1.1-pro, taking `n` and `size` and returning a URL.

So a team on FLUX.2-pro is likely calling a BFL-shaped body (`width`, `height`, `num_images`, `input_image`, `input_image_2`), while a team on FLUX-1.1-pro may be calling `client.images.generate`. If call sites across services build these bodies themselves, a retirement is a multi-repo change. That is the real cost to remove: not the model swap but the number of places that know a vendor's body.

The fix is the usual one. Define one internal image request, make a single module the only code that talks to a backend, and let a config value pick the backend. The rest of this guide assumes that boundary exists, or that you build it first.

## The stable shape: one request in, one result out

Keep the internal shape small and in your own vocabulary. Anything a backend cannot honor should fail loudly in the adapter rather than be silently dropped.

```python
from dataclasses import dataclass, field

@dataclass
class ImageJob:
    prompt: str
    width: int = 1024
    height: int = 1024
    n: int = 1
    seed: int | None = None
    fmt: str = "png"                      # "png" | "jpeg"
    refs: list[bytes] = field(default_factory=list)  # reference images
    tags: dict = field(default_factory=dict)         # feature, tenant, canary arm

@dataclass
class ImageResult:
    images: list[bytes]
    backend: str                          # which backend actually served it
    width: int
    height: int
    fmt: str

def to_azure_bfl(job: ImageJob, model_id: str) -> dict:
    body = {
        "model": model_id,                # e.g. "FLUX.2-pro"
        "prompt": job.prompt,
        "width": job.width,
        "height": job.height,
        "num_images": job.n,
        "output_format": job.fmt,
    }
    if job.seed is not None:
        body["seed"] = job.seed
    for i, ref in enumerate(job.refs):    # input_image, input_image_2, ...
        key = "input_image" if i == 0 else f"input_image_{i + 1}"
        body[key] = ref.decode("ascii")   # base64 text already
    return body

def to_gateway(job: ImageJob, model: str) -> dict:
    body = {
        "model": model,                   # a model id or a route slug
        "prompt": job.prompt,
        "n": job.n,
        "size": f"{job.width}x{job.height}",
        "response_format": "url",
    }
    if job.seed is not None:
        body["seed"] = job.seed
    return body
```

The first adapter follows the body Microsoft documents for FLUX.2 [pro], including numbered reference-image fields.[4] The second targets INFRO's `/v1/images/generations` shape, where the model is a vendor/model id like `bfl/flux-2-pro` or the slug of a route.[5] Only the adapter changes when the backend does.

## Parameter mapping

The same intent is spelled differently on each surface. This table maps the fields a typical FLUX caller uses.

| Intent | Foundry BFL API | Foundry Image API | INFRO `/v1/images` |
| --- | --- | --- | --- |
| Prompt | `prompt` | `prompt` | `prompt` (up to 32,000 characters) |
| Dimensions | `width`, `height`, `aspect_ratio` | `size` | `size`, or `resolution` plus `aspect_ratio`, not both |
| Count | `num_images` | `n` | `n`, 1–10 |
| Format | `output_format` | not set in the documented examples | `response_format`: `url` or `b64_json` |
| Seed | `seed` | not shown | `seed`, forwarded only where the model takes it |
| Guidance, steps | `guidance`, `steps` (FLUX.2 [flex] example) | not available | no universal field; check the model's settings |
| Safety level | `safety_tolerance` | not shown | not a universal field |
| References | `input_image`, `input_image_2`… | `images/edits` (Kontext only) | `/v1/images/edits` |

Table: Field mapping. "Not shown" means the page's examples do not use it, not that it is unsupported.

Sources for the columns: Foundry's FLUX page for the first two,[4] and INFRO's image docs for the third.[5]

Two mapping details cause most surprises. First, INFRO passes `size` to the provider unchanged, and a resolution tier or aspect ratio the model cannot render on a target is refused before that target is called.[5] That is useful, since you learn about an unsupported ratio from a 400 and not from a wrongly cropped image, but it means your adapter should send exact pixels or tiers deliberately. Second, `quality` is sent only where a model has a quality setting and is dropped elsewhere, so a FLUX-era caller that never set it will not see a difference, while one that expects it to matter on a GPT Image target will.[5]

Fields with no portable equivalent, such as `guidance`, `steps` and `safety_tolerance`, should live in a per-backend options dict in your config, not in the shared shape. If you rely on them for look, you are tuning to FLUX, and the new backend needs its own tuning.

## Output differences to check

A swap that returns HTTP 200 can still break downstream code. The migration guidance says a different model can quietly shift formatting and output shape and break code that depends on the old behavior.[3] For images, check these:

- **Dimensions and format.** FLUX.2 [flex] outputs one image as PNG or JPG with a maximum of 4 MP;[4] a new target may round sizes, cap resolution or return a different container. Assert width, height and MIME type on every result in the canary.
- **Count.** INFRO sends `n` to the provider as-is, a provider may return fewer, and `usage.images` counts what came back.[5] Do not assume `len(images) == n`.
- **Delivery.** Foundry's BFL responses carry a URL or base64 data.[4] INFRO's default returns a signed link to a copy it stores for 24 hours, and `b64_json` returns the image inline, at several megabytes each.[5] Download and keep what you need; do not store the link as the asset.
- **Reference images.** FLUX.2 [pro] takes up to eight and FLUX.2 [flex] up to 10 reference images,[4] and a different model may take fewer or none. A request with more references than the target takes must fail in the adapter, not be truncated.
- **Seeds.** Seeds are best-effort and forwarded only where supported.[5] A fixed seed on a new backend gives you a stable draw within that backend, not the old images.
- **Moderation.** Refusal behavior differs by model. Track refusal rate per arm; a prompt set that always passed on FLUX may not on the target.

> **Warning: Text in images**
> Foundry describes FLUX.2 [flex] as suited to text-heavy layouts and fine detail.[4] If your prompts put legible text in the image, give those prompts their own slice of the test set; they are the likeliest to regress on another model.

## Choosing a target without a listed replacement

With no official replacement, you choose. The options, without ranking them:

1. **Another host of the same FLUX family.** INFRO's docs give `bfl/flux-2-pro` as an example model id and say image requests can be served by connections to providers including OpenAI, Azure OpenAI, Google AI, Vertex AI, Together AI, OpenRouter, Runway, KIE, LaoZhang API, fal.ai, Replicate and OpenAI-compatible endpoints.[5] Which models each of those serves for your account is in the catalog, and a model is available only if one of your own connections serves it.[6] Same family keeps prompt style, but you take on a new vendor contract and a new credential.
2. **A non-FLUX model that stays on Azure.** The same schedule shows gpt-image-2 at 2027-10-21 and gpt-image-2.5-flare and -sunburst at 2027-09-09, among other image models.[1] That keeps your Azure contract and data path, but it is a different model with different prompt conventions and no FLUX-specific parameters.
3. **Another vendor's image model through your own connection.** The widest quality search, and the largest prompt rework.

Whichever you pick, follow Microsoft's own advice: evaluate on your application, prompts and representative data, comparing quality, latency and cost together, and confirm API compatibility, regional availability, capacity and quota.[2] Replay your current configuration unchanged on the target first, then tune, so you can separate what the model changed from what you changed.[3]

Cost belongs in that comparison, but this article does not quote rates: none were confirmed. Use the vendor's own price page for each candidate, apply your negotiated rate if you have one, and project from your historical image counts and size mix.

## A canary plan that fits the calendar

You have roughly 51 days to the first date. Work backwards and leave a week of slack, since a retired model returns `410 Gone`.[2]

1. **Freeze a prompt set.** Pull a few hundred real prompts, stratified by feature, with and without reference images and with text in the image. Do not edit it mid-migration; Microsoft's guidance is to keep inputs and success criteria fixed or you cannot compare.[3] Production content capture is opt-in and never retroactive, so turn it on now if it is off.
2. **Shadow run.** Send the set to the target offline. Check the contract: dimensions, format, count, refusals, latency. Fix adapter errors here.
3. **Blind review.** Have reviewers choose between old and new outputs without labels. Use pairwise preference per feature, not one global score.
4. **Weighted canary.** Move live traffic in steps behind one name. INFRO's weighted route picks the first target at random in proportion to its weight and still falls through the rest if it fails; a target at weight 0 is a standby.[7] The route name is what your application sends as `model`, so the code does not change between steps.[7]
5. **Hold the old path as standby** until the retirement date, then remove it.

> **Example: Illustrative ramp**
> These numbers are illustrative, not measured. Start at 1% for a day, then 5%, 25%, 50% and 100%, advancing only when the new arm's error rate, p95 latency and refusal rate sit within limits you set before starting (for example, no more than 2 points above the old arm). Keep the old target at weight 0 after cutover so it remains a failover target until it retires.

Rules on a route can carry a request-level condition such as `has_images`, `feature` or `end_user_id`,[7] which lets you canary reference-image edits separately from plain text-to-image, or keep an internal team on the new backend first. Fallbacks and connection failover act only before the response starts, and the response names the model, provider and connection that served it,[8] so tag every result with its arm and compare the arms from the log, not from memory.

## What a gateway does and does not do here

A control plane can carry this migration but cannot make two models equal. In INFRO, image requests share one shape across providers, the route holds the backend choice in configuration, and each response records the serving provider and estimated provider cost in `usage.cost`.[5] INFRO records vendor retirements and refuses a retired model from its shutdown date with an error naming the replacement, but its docs say Azure runs its own schedule and is covered only when Azure's own date is recorded,[6] so confirm the Foundry FLUX dates in the console and do not rely on a refusal as your cutover trigger. INFRO never answers with a different model on your behalf.[6]

The checks above (frozen prompt set, blind review, per-arm metrics) stay your job, with or without a gateway.

## Checklist

- [ ] List every service and repo that calls a FLUX deployment, and which of the two Foundry routes it uses.
- [ ] Route all of them through one module with the internal request shape.
- [ ] Re-read the retirement schedule for a newly named replacement.
- [ ] Shortlist two targets and confirm region, quota and contract for each.
- [ ] Freeze a prompt set, including reference-image and text-in-image slices.
- [ ] Assert dimensions, MIME type and image count in the adapter.
- [ ] Run a shadow pass, then blind pairwise review.
- [ ] Canary in steps with the old path kept as standby.
- [ ] Remove the FLUX deployments after cutover and update your docs and runbooks.
- [ ] Finish before 2027-01-05 for FLUX-1.1-pro and Kontext, and before 2027-01-20 for FLUX.2.

## Questions

### Will Azure auto-upgrade my FLUX deployments at retirement?

Do not plan on it. The retirement schedule lists no replacement for any of the four FLUX models.[1] Microsoft says auto-upgrades target the listed replacement where supported, and that retired models return 410 Gone, so treat the date as a hard stop.[2]

### Can I keep the same seed to reproduce images on a new backend?

Treat seeds as best-effort. INFRO forwards a seed only to providers whose model takes one and drops it elsewhere,[5] and a different backend or model version will not reproduce the same pixels even when it accepts the value. Compare outputs by scoring, not by pixel diff.

## Sources

1. Model retirement schedule — Microsoft Learn. https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/model-retirement-schedule (accessed 2026-11-15)
2. Microsoft Foundry Models lifecycle and support policy — Microsoft Learn. https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/model-retirements (accessed 2026-11-15)
3. Model migration: upgrade or switch models in Microsoft Foundry — Microsoft Learn. https://learn.microsoft.com/en-us/azure/foundry/foundry-models/concepts/model-migration (accessed 2026-11-15)
4. Deploy and use FLUX models in Microsoft Foundry — Microsoft Learn. https://learn.microsoft.com/en-us/azure/foundry/foundry-models/how-to/use-foundry-models-flux (accessed 2026-11-15)
5. Image generation — Modalities — INFRO Docs. https://infro.io/docs/modalities/images (accessed 2026-11-15)
6. Models — Get started — INFRO Docs. https://infro.io/docs/models (accessed 2026-11-15)
7. Routes — Features — INFRO Docs. https://infro.io/docs/routes (accessed 2026-11-15)
8. Failover & fallbacks — INFRO Docs. https://infro.io/docs/features/fallbacks (accessed 2026-11-15)
