Skip to content

chant has no Azure apply path: add an Azure applier (per-resource ARM PUT → floci-az / real ARM) #707

Closed

Description

@lex00

Goal

Give chant a first-class Azure apply path — an Op + apply component that drives
az deployment of the ARM template chant already emits, instead of the user running it
by hand. Today the azure lexicon can generate but not deploy.

The gap (found in the deploy-Op coverage audit, #704 / #705)

  • AWS has a full apply surface: lexicons/aws/src/components/ (apply.ts,
    cloud-executor.ts, wait-aws.ts, safety.ts, …) plus real deploy Ops
    (lexicons/aws/examples/lifecycle-reconcile-aws/ops/{apply,reconcile}.op.ts).
  • k8s deploys via the kubectlApply / helmInstall / waitForStack activities.
  • Azure has neither — no components/ dir, no deploy Op (only a lexicon-upgrade
    op). The serializer emits an ARM template (deploymentTemplate.json); actually
    deploying it is a manual az deployment documented only in the chant-azure
    skills.

So chant cannot drive an Azure deploy at all — real or local.

Why this is independent of, and higher-leverage than, the emulator work

The floci-az Microsoft.Resources/deployments contribution (#705) unblocks the
emulator, but chant would still have nothing to drive it with. This apply path is a
prerequisite for local-Azure — and it also enables real Azure deploys, which
chant can't do today either. It stands on its own regardless of #705.

What to build (mirror the AWS pattern)

  1. Azure apply component (analogous to lexicons/aws/src/components/apply.ts +
    cloud-executor.ts):
    • Ensure resource group, run az deployment group create (and/or subscription
      scope) against the emitted ARM template, pass parameters, poll to terminal state,
      surface outputs.
    • Endpoint override so the same component targets real Azure or a local
      emulator (az cloud register custom cloud / ARM endpoint) — the Azure analogue of
      AWS's AWS_ENDPOINT_URL in cloud-executor.ts. This is what lets it point at
      floci-az once Research: local-deploy feasibility for Azure (floci-az) + GCP (floci-gcp) #705 lands.
    • A wait-azure analogue if needed; reuse safety-style guards.
  2. Azure deploy Op (mirror lifecycle-reconcile-aws/ops/apply.op.ts): phases
    build → deploy (az deployment) → wait.

Place in the azure lexicon behind the capability seam, consistent with the AWS
components relocation.

Acceptance criteria

  • An Azure apply component deploys an emitted ARM template end-to-end via
    az deployment against real Azure (a small example stack).
  • An Azure deploy Op composes build → deploy → wait and runs via the local
    executor.
  • Endpoint override is supported (custom cloud / ARM endpoint), so the same path can
    target a local emulator — the hook Research: local-deploy feasibility for Azure (floci-az) + GCP (floci-gcp) #705 depends on.
  • Rough parity with the AWS apply surface (resource-group ensure, param passing,
    wait/poll, output capture).

Relationships

Out of scope

Activity

  1. added
    enhancement
    on Jul 7, 2026
  2. lex00 commented on Jul 8, 2026

    @lex00
    ContributorAuthor

    ✅ Real-Azure apply path — done in #710 (merged).

    nativeApply({target:"arm"}) already runs az deployment group create, but it needs the resource group to exist first. Added the missing RG lifecycle:

    • azGroupEnsure/azGroupDelete builders (core) + idempotent/non-blocking activity impls (temporal lexicon) + pure command builders + tests (3).
    • Demo op examples/local-op-quickstart/ops/azure-deploy.op.ts: group ensure → build → arm deploy → group delete.

    chant can now drive a first-class real Azure deploy. Still open on this issue: the local floci-az half — blocked until floci-az implements Microsoft.Resources/deployments (#705); the endpoint/custom-cloud override slots into azGroupEnsure when that lands.

  3. lex00 commented on Jul 8, 2026

    @lex00
    ContributorAuthor

    ✅ Local Azure apply unblocked — azApply shipped in #722 (merged). Direct ARM-resource applier: reads chant's built ARM template, evaluates the ARM expressions (concat/uniqueString/resourceGroup/subscription), and PUTs each resource straight to floci-az's ARM resource CRUD — bypassing az deployment, which floci-az can't do. Verified live: basic-storage → storage account created on floci-az (GET 200). Azure now joins AWS (floci/CFN) and GCP (floci-gcp/gcpApply) as locally-runnable.

  4. lex00 commented on Jul 8, 2026

    @lex00
    ContributorAuthor

    ✅ reference()/listKeys() + ARM ordering shipped — #725 (merged). azApply's evaluator now handles resourceId, reference('name') (runtime properties), and listKeys(...) (async key action) with .prop/[index] access, and applies resources in dependency order (referenced before referrer, cycle-detecting). Verified live on floci-az: an out-of-order 2-storage template reorders and the sink resolves the source's real listKeys key + reference blob endpoint.

    Azure now matches GCP on expressions + ordering. Remaining Azure-vs-GCP gap: resource-level delete/prune.

  5. changed the title [-]chant has no Azure apply path: add an Azure deploy Op + apply component (az deployment)[/-] [+]chant has no Azure apply path: add an Azure applier (per-resource ARM PUT → floci-az / real ARM)[/+] on Aug 2, 2026
  6. lex00 commented on Aug 2, 2026

    @lex00
    ContributorAuthor

    Shipped in 0.15.0 and verified today against a current floci/floci-az:latest. Closing.

    $ chant run azure
    emulator "chant-floci-az" ready on http://localhost:4577
    applied: Microsoft.Storage/storageAccounts/triostore (http://localhost:4577)
    httpCheck OK: …/resourceGroups/trio-rg/providers/Microsoft.Storage/storageAccounts/triostore?api-version=2025-06-01 (200)
      ✓ flociAzUp / chantBuild / azApply / httpCheck / flociAzDown
    

    The title said az deployment; the applier does not, and this is the correction #1204 asked for. az-apply.ts PUTs each resource at /subscriptions/{sub}/resourceGroups/{rg}/providers/{type}/{name}?api-version=… (armResourceUrl, line ~254; the PUT at line ~329). There is no Microsoft.Resources/deployments call, and floci-az has no deployments provider to make one against. The title now matches the transport that shipped, so closing it does not leave the wrong mechanism in the record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions