Skip to content

Conversation

@jepetty
Copy link
Contributor

@jepetty jepetty commented Jan 28, 2026

Related command

az containerapp env workload-profile add -n <name> -g <resourceGroup> --workload-profile-type <wpType>

Description

This simplifies CLI invocation when creating a new workload-profile for ACA without a name. We will try to provide an intelligent default (i.e. the type of the workload profile)

Testing Guide

# Create a container environment
az containerapp env create -n <name> -g <resourceGroup>
# Create a workload profiles
az containerapp env workload-profile add -n <name> -g <resourceGroup> --workload-profile-type flex
az containerapp env workload-profile add -n <name> -g <resourceGroup> --workload-profile-type D4 --min-nodes 2 --max-nodes 4

This will create two workload profiles:

  • A Flex profile with name "flex"
  • A D4 profile with name "d4"

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

Copilot AI review requested due to automatic review settings January 28, 2026 01:44
@azure-client-tools-bot-prd
Copy link

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

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

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

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

⚠️AzureCLI-BreakingChangeTest
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1009 - ParaPropRemove containerapp env workload-profile add cmd containerapp env workload-profile add update parameter workload_profile_name: removed property required=True

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 28, 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>

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request simplifies the creation of flex workload profiles in Azure Container Apps by making the --workload-profile-name parameter optional when the profile type is "flex". The API automatically assigns a default name for flex profiles, removing the need for users to provide one manually.

Changes:

  • Made workload_profile_name parameter optional in the add_workload_profile function
  • Added validation to require --workload-profile-name only for non-flex workload profile types
  • Updated workload profile setup logic to handle None values for profile names
  • Added comprehensive test case to verify flex profiles can be created without names and non-flex profiles still require names

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
custom.py Made workload_profile_name parameter optional with default value None, updated duplicate name check to handle None
containerapp_env_decorator.py Added validation requiring profile names only for non-flex types, updated profile matching logic to handle None names
test_containerapp_workload_profile_commands.py Added test verifying flex profiles work without names and non-flex profiles fail without names
Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/containerapp/containerapp_env_decorator.py:311

  • The comment says "flex profiles will be named automatically" but this is an implementation detail of the API, not the CLI. Consider clarifying that the API (not the CLI) assigns the default name, e.g., "workload-profile-name is optional for flex profiles as the API will assign a default name automatically".
        # validate workload profile arguments - flex profiles will be named automatically

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Greedygre
Copy link
Contributor

Hi @jepetty

Which command this PR for? az containerapp env workload-profile is a command group, not a command.

I reviewed this PR, the change is related to command az containerapp env update -n <name> -g <resourceGroup> --workload-profile-type flex

Please add more test case and description for the PR change.


if workload_profile_name:
# We have already validated that the configuration is valid if adding a workload profile
if workload_profile_name or workload_profile_type:
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change want support command only input --workload-profile-type without --workload-profile-name?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the name is optional for Flex (but if set it must be Flex, just like Consumption), just trying to simplify the commands. What if we made the name optional for all profiles and set it to the same as the type?
--workload-profile-type D4 creates a profile with name: D4, type: D4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Tratcher I was wondering yesterday why we don't do this for every type. I'll submit a PR to the API if you agree this is the right design

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Greedygre / @Tratcher, we followed up with @simonjj and have agreed to make this the default behavior from the CLI for all workload-profile types. If the type is provided but not the name, and there's not an existing profile with the same name, we'll create a new WP with name == type. i.e. az containerapp env workload-profile add -n d4-env -g d4-rg --workload-profile-type D4 would create a new WP with name "d4" and type "D4". I will update accordingly

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 29, 2026

Please fix CI issues

@jepetty jepetty changed the title [containerapp] az containerapp env workload-profile -n <name> -g <resourceGroup> --workload-profile-type flex Simplify flex wp creation [containerapp] az containerapp env workload-profile add -n <n> -g <g> --workload-profile-type <type> Simplify wp creation Jan 29, 2026
@jepetty
Copy link
Contributor Author

jepetty commented Jan 29, 2026

Hi @jepetty

Which command this PR for? az containerapp env workload-profile is a command group, not a command.

I reviewed this PR, the change is related to command az containerapp env update -n <name> -g <resourceGroup> --workload-profile-type flex

Please add more test case and description for the PR change.

Sorry for the confusion, @Greedygre, you're right, I definitely missed some words in the description 😅 Updated the description and added some clarity about scope, let me know if you still see missing things that should be added. Thanks for the review!

@jepetty jepetty changed the title [containerapp] az containerapp env workload-profile add -n <n> -g <g> --workload-profile-type <type> Simplify wp creation [containerapp] az containerapp env workload-profile add Simplify wp creation with default profile name Jan 29, 2026
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.

5 participants