Skip to content

feat(run): add --env for inline environment overrides#498

Open
jongio wants to merge 1 commit into
mainfrom
idea/run-env-inline
Open

feat(run): add --env for inline environment overrides#498
jongio wants to merge 1 commit into
mainfrom
idea/run-env-inline

Conversation

@jongio

@jongio jongio commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Implements #493.

azd app run can already load variables from a file with --env-file, but there was no way to set one inline. This adds a repeatable --env KEY=VALUE flag that merges into the resolved environment passed to each service, with inline values winning over --env-file and azure.yaml.

  • --env KEY=VALUE is repeatable in a single run.
  • Inline values override --env-file and azure.yaml.
  • An entry without = or with an empty key returns a clear error.
  • Values may be empty or contain = characters.

Tests cover parsing, multi-value merge, precedence, and the error path. CLI reference updated.

Closes #493

Add a repeatable --env KEY=VALUE flag to azd app run that merges inline overrides into the resolved service environment. Inline values take precedence over --env-file and azure.yaml. Malformed entries return a clear error.

Closes #493

Co-authored-by: Copilot App <[email protected]>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 12, 2026
@jongio jongio self-assigned this Jul 12, 2026
github-actions Bot added a commit that referenced this pull request Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Website Preview

Your PR preview is ready!

📎 Preview URL: https://jongio.github.io/azd-app/pr/498/

This preview will be automatically cleaned up when the PR is closed.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.79%. Comparing base (dd00a47) to head (73f28f9).

Files with missing lines Patch % Lines
cli/src/cmd/app/commands/run.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
+ Coverage   60.77%   60.79%   +0.02%     
==========================================
  Files         223      223              
  Lines       28527    28538      +11     
==========================================
+ Hits        17337    17351      +14     
+ Misses      10010    10006       -4     
- Partials     1180     1181       +1     
Flag Coverage Δ
unittests 60.79% <87.50%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cli/src/cmd/app/commands/run.go 16.54% <87.50%> (+5.19%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Test This PR

A preview build (0.19.5-pr498) is ready for testing!

🌐 Website Preview

Live Preview: https://jongio.github.io/azd-app/pr/498/

One-Line Install (Recommended)

PowerShell (Windows):

iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/install-pr.ps1) } -PrNumber 498 -Version 0.19.5-pr498"

Bash (macOS/Linux):

curl -fsSL https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/install-pr.sh | bash -s 498 0.19.5-pr498

Uninstall

When you're done testing:

PowerShell (Windows):

iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/uninstall-pr.ps1) } -PrNumber 498"

Bash (macOS/Linux):

curl -fsSL https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/uninstall-pr.sh | bash -s 498

Build Info:

What to Test:
Please review the PR description and test the changes described there.

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

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add run --env KEY=VALUE for inline environment overrides

1 participant