-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Container app] az containerapp env create: Update the error display for CO environment creation
#32648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this 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 PR improves the error message displayed when users attempt to create a Consumption-Only Container Apps environment with a name that matches an existing Workload Profiles environment. Previously, users would see a confusing error "At least 1 workload profile must be specified"; now they receive a clear message explaining that the existing environment uses workload profiles and suggesting they create a new one.
Changes:
- Enhanced validation logic to detect when a Consumption-Only environment creation conflicts with an existing Workload Profiles environment
- Added test coverage for the new validation error message
- Removed unused imports from test files
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/containerapp/containerapp_env_decorator.py | Refactored workload profile setup to check for existing environments earlier and added validation for the Consumption-Only conflict scenario |
| src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_env_commands.py | Added test case to verify new error message and imported ValidationError exception |
| src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_compose_registries.py | Removed unused create_containerapp_env import |
| src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_compose_environment.py | Removed unused create_containerapp_env import |
| src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_compose_basic.py | Removed unused create_containerapp_env import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/containerapp/containerapp_env_decorator.py
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Please fix CI issues |
|
About the CI failed , it is because in azure-cli env, it will not install containerapp extension, so the api-version for containerapp API should be Please remove az containerapp extension will command |
|
These tests are failed. They relate to the PR's change. Recommend to update the tests: |
az containerapp env create: Update the error display for CO environment creation
|
/azp run |
|
Commenter does not have sufficient privileges for PR 32648 in repo Azure/azure-cli |
|
Thank you, @Greedygre for the helpful tips! I believe I have fixed these |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az containerapp env create: Update the error display for CO environment creationaz containerapp env create: Update the error display for CO environment creation
Related command
az containerapp env create --name --resource-group --enable-workload-profiles false
Description
This is a small change to make the error message clearer for users when they try to create a ConsumptionOnly environment but an existing WorkloadProfiles environment with the same name already exists. The previous error was "At least 1 workload profile must be specified" - very confusing
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.