Skip to content

azure.yaml web buildArgs are unquoted — remote build fails when env var values contain spaces #33

Description

@vladpm

Summary

The web service buildArgs in azure.yaml reference environment variables without quotes. When any value contains a space (e.g. a friendly app name like Leeds Digital Permits), the ACR remote build (remoteBuild: true) fails, because the space is split at the shell level and the docker build context argument is lost.

Since these values are meant to hold human-readable text (app name, support fields), values with spaces are the common case, not an edge case.

Error

2026/... Launching container with name: build
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage:  docker build [OPTIONS] PATH | URL | -
Container failed during run: build. No retries remaining.
failed to run step ID: build: exit status 1
ERROR: step "publish-web" failed: publishing service web: ... remote build failed

Only the web service fails, because it is the only one with buildArgs.

Root cause

Current azure.yaml:

      buildArgs:
        - NEXT_PUBLIC_APP_NAME=${NEXT_PUBLIC_APP_NAME}
        - NEXT_PUBLIC_APP_URL=${SERVICE_WEB_URI}
        - NEXT_PUBLIC_SUPPORT_EMAIL=${NEXT_PUBLIC_SUPPORT_EMAIL}
        - NEXT_PUBLIC_SUPPORT_PHONE=${NEXT_PUBLIC_SUPPORT_PHONE}
        - NEXT_PUBLIC_DEMO_MODE=${NEXT_PUBLIC_DEMO_MODE}
        - NEXT_PUBLIC_SHOW_SAMPLE_BANNER=${NEXT_PUBLIC_SHOW_SAMPLE_BANNER}

NEXT_PUBLIC_APP_NAME (and the NEXT_PUBLIC_SUPPORT_* fields) are expected to hold values with spaces, so unquoted expansion breaks the remote build for any realistic deployment.

Proposed fix

Wrap each build-arg value in quotes so spaces are preserved through to docker build --build-arg:

      buildArgs:
        - NEXT_PUBLIC_APP_NAME="${NEXT_PUBLIC_APP_NAME}"
        - NEXT_PUBLIC_APP_URL="${SERVICE_WEB_URI}"
        - NEXT_PUBLIC_SUPPORT_EMAIL="${NEXT_PUBLIC_SUPPORT_EMAIL}"
        - NEXT_PUBLIC_SUPPORT_PHONE="${NEXT_PUBLIC_SUPPORT_PHONE}"
        - NEXT_PUBLIC_DEMO_MODE="${NEXT_PUBLIC_DEMO_MODE}"
        - NEXT_PUBLIC_SHOW_SAMPLE_BANNER="${NEXT_PUBLIC_SHOW_SAMPLE_BANNER}"

Steps to reproduce

  1. azd env set NEXT_PUBLIC_APP_NAME "Leeds Digital Permits" (a value containing a space)
  2. azd up (uses remoteBuild: true)
  3. The web build fails with "docker build" requires exactly 1 argument.

Environment

  • azd remote build (ACR Tasks), remoteBuild: true
  • Reproduced on a governed subscription, region UK South, Premium ACR

Impact

Any deployment that sets a multi-word app name / support fields (the common, intended case) fails at the web build step.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions