Skip to content

[containerapp] az containerapp [create/update] --environment-mode WorkloadProfiles Add environment mode to az containerapp#9551

Open
jepetty wants to merge 14 commits intoAzure:mainfrom
jepetty:addEnvironmentMode
Open

[containerapp] az containerapp [create/update] --environment-mode WorkloadProfiles Add environment mode to az containerapp#9551
jepetty wants to merge 14 commits intoAzure:mainfrom
jepetty:addEnvironmentMode

Conversation

@jepetty
Copy link
Contributor

@jepetty jepetty commented Jan 27, 2026


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

Related command

az containerapp env create --name --resource-group --environment-mode WorkloadProfiles
az containerapp env update --name --resource-group --environment-mode WorkloadProfiles

Why this change over the existing --enable-workload-profiles switch?
The Azure Container Apps team is experimenting with new environment types beyond just ConsumptionOnly and Dedicated/Consumption leveraging new technologies. This change enable us to rapidly iterate on this experimentation by easily creating new environments, as well as ensure the experience of creation through CLI is prioritized the entire time.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings January 27, 2026 01:01
@jepetty jepetty requested a review from Greedygre as a code owner January 27, 2026 01:01
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jan 27, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️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

@azure-client-tools-bot-prd
Copy link

Hi @jepetty,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 27, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Feb 11, 2026
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Feb 11, 2026
with self.argument_context('containerapp env') as c:
c.argument('public_network_access', arg_type=get_enum_type(['Enabled', 'Disabled']),
help="Allow or block all public traffic", is_preview=True)
c.argument('environment_mode', options_list=["--environment-mode"], help="Mode of the environment.", is_preview=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the value allowed?
Recommend to use arg_type=get_enum_type(["consumptiononly"]) to make it more clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to constrain the type right now because we're introducing several experimental values and names may frequently change.

@Greedygre
Copy link
Contributor

May I ask why do we need to add --environment-mode? Seems this change not relate to backend feature?
Is it only relate to CLI behavior?

az containerapp env create --name --resource-group --environment-mode WorkloadProfiles
az containerapp env update --name --resource-group --environment-mode WorkloadProfiles

We already have -w, what is the difference?:

 --enable-workload-profiles -w                                         : Boolean indicating if
                                                                            the environment is
                                                                            enabled to have workload
                                                                            profiles.  Allowed
                                                                            values: false, true.
                                                                            Default: True.

@Greedygre
Copy link
Contributor

May I ask why do we need to add --environment-mode? Seems this change not relate to backend feature? Is it only relate to CLI behavior?

az containerapp env create --name --resource-group --environment-mode WorkloadProfiles
az containerapp env update --name --resource-group --environment-mode WorkloadProfiles

We already have -w, what is the difference?:

 --enable-workload-profiles -w                                         : Boolean indicating if
                                                                            the environment is
                                                                            enabled to have workload
                                                                            profiles.  Allowed
                                                                            values: false, true.
                                                                            Default: True.

Base on the code, the --environment-mode WorkloadProfiles equals -w, right? And --environment-mode consumptiononly equals -w false.

I think in portal, we already deprecate -w false, we cannot create consumptiononly environment from portal now.
Why you create a new params in CLI to support this? what is the business background? @jepetty

@jepetty
Copy link
Contributor Author

jepetty commented Feb 12, 2026

May I ask why do we need to add --environment-mode? Seems this change not relate to backend feature? Is it only relate to CLI behavior?

az containerapp env create --name --resource-group --environment-mode WorkloadProfiles
az containerapp env update --name --resource-group --environment-mode WorkloadProfiles

We already have -w, what is the difference?:

 --enable-workload-profiles -w                                         : Boolean indicating if
                                                                            the environment is
                                                                            enabled to have workload
                                                                            profiles.  Allowed
                                                                            values: false, true.
                                                                            Default: True.

@Greedygre great question! Chatted a bit offline, but including here as well

We're in the process of experimenting with new environment types aside from our v1 ConsumptionOnly and v2 Dedicated/Consumption environments. We're experimenting with better experiences for our users - both in terms of speed of provisioning/environment creation and in terms of cost-savings. I do think we should consider deprecating the -w flag, and I'm happy to create an issue to perform this work, let me know what you think!

@jepetty
Copy link
Contributor Author

jepetty commented Feb 12, 2026

Updated the PR description to provide additional background for this change - thanks for the questions, @Greedygre!

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

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments