Skip to content

[ContainerApp] az containerapp env: Add --environment-mode - #34486

Open
Chris Ross (Tratcher) wants to merge 2 commits into
Azure:devfrom
Tratcher:user/tratcher/containerapp-environment-mode
Open

Chris Ross (Tratcher) wants to merge 2 commits into
Azure:devfrom
Tratcher:user/tratcher/containerapp-environment-mode

Conversation

@Tratcher

@Tratcher Chris Ross (Tratcher) commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests
⚠️ None ️✔️ 130/130
⚠️AzureCLI-BreakingChangeTest
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd containerapp env create cmd containerapp env create added parameter environment_mode
⚠️ 1006 - ParaAdd containerapp env update cmd containerapp env update added parameter environment_mode

Related command
az containerapp env create --environment-mode
az containerapp env update --environment-mode

Description
Exposing this new property for selecting and changing modes

Testing Guide
az containerapp env create -n MyContainerappEnvironment -g express-cli-rg --location eastus2 --environment-mode Express --logs-destination None
az containerapp env update -n MyContainerappEnvironment -g express-cli-rg --environment-mode Archived

History Notes
[ContainerApp] az containerapp env: Add --environment-mode


This checklist is used to make sure that common guidelines for a pull request are followed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Hi Chris Ross (@Tratcher),
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@Tratcher Chris Ross (Tratcher) changed the title [ContainerApp] az containerapp env: Add --environment-mode [ContainerApp] az containerapp env: Add --environment-mode Nov 23, 2026
@Tratcher

Copy link
Copy Markdown
Member Author

Title fixed

@Tratcher
Chris Ross (Tratcher) marked this pull request as ready for review November 24, 2026 00:23
Copilot AI balanced review requested due to automatic review settings November 24, 2026 00:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The environment-mode update test uses the existing mode, so it cannot detect an ignored PATCH, and no test verifies a supported mode transition through both the update response and a subsequent show.

1 open issue
What changed in this PR

Adds --environment-mode to Azure CLI’s Container Apps environment commands, allowing users to select a mode during creation or request a mode change.

Changes:

  • Exposes the new option on containerapp env create and containerapp env update.
  • Adds mode-aware payload construction and compatibility checks for legacy workload-profile flags.
  • Adds help text, examples, unit tests, and a live scenario.
File Description
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​tests/​latest/​test_containerapp_env_environment_mode.py Adds unit coverage for validation, payloads, and REST requests.
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​tests/​latest/​test_containerapp_env_commands.py Adds a live environment-mode scenario.
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​custom.py Accepts the mode in create and update handlers.
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​containerapp_env_decorator.py Builds mode-aware payloads and handles workload-profile compatibility.
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​_utils.py Validates conflicts between mode and legacy flags.
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​_params.py Registers --environment-mode for both commands.
src/​azure-cli/​azure/​cli/​command_modules/​containerapp/​_help.py Documents mode selection and update behavior.

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@Tratcher

Copy link
Copy Markdown
Member Author

Fixed history notes. That CI error need work...

@x-engineering-agent

Copy link
Copy Markdown
Contributor

@Tratcher

Copy link
Copy Markdown
Member Author

I already fixed them, it needs to re-run.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants