Skip to content

Conversation

@Tratcher
Copy link
Contributor

@Tratcher Tratcher commented Apr 22, 2025

Enables configuring the new environment premium ingress settings.

Continues https://github.com/Azure/azure-cli-extensions/pull/8670/files

Related command

az containerapp env premium-ingress

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

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

azure-client-tools-bot-prd bot commented Apr 22, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd containerapp env premium-ingress sub group containerapp env premium-ingress added

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

Hi @Tratcher,
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 Apr 22, 2025

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>

@Tratcher Tratcher force-pushed the ingress-configuration-for-containerapp branch from 688370a to 716dc61 Compare May 27, 2025 16:54
@Greedygre
Copy link
Contributor

Here is the PR to update api-version to 2025-02-02-preview: #8791

@Tratcher Tratcher force-pushed the ingress-configuration-for-containerapp branch from 0c018bc to 2696bd3 Compare May 28, 2025 23:02
@Greedygre
Copy link
Contributor

=========================== short test summary info ============================
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py::ContainerappIngressTests::test_containerapp_env_premium_ingress_commands
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py::ContainerappIngressTests::test_containerapp_ingress_traffic_labels_e2e
============ 2 failed, 152 passed, 61 skipped in 1071.33s (0:17:51) ============

E vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_env_premium_ingress_commands.yaml') in your current record mode ('once').
E No match for the request (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/containerapp-env000002?api-version=2025-02-01>) was found.
E Found 1 similar requests with 1 different matcher(s) :
E
E 1 - (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/containerapp-env000002?api-version=2023-09-01>)..)
E Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E Matchers failed :
E _custom_request_query_matcher - assertion failure :
E None

Hi @Tratcher

Seems your azure-cli dev branch need to pull the latest code and set_up again.

Comment on lines 666 to 669
logs_workspace_name = self.create_random_name(prefix='containerapp-env', length=24)

logs_workspace_id = self.cmd(f'monitor log-analytics workspace create -g {resource_group} -n {env_name} -l eastus'.format(resource_group, logs_workspace_name)).get_output_in_json()["customerId"]
logs_workspace_key = self.cmd(f'monitor log-analytics workspace get-shared-keys -g {resource_group} -n {env_name}'.format(resource_group, logs_workspace_name)).get_output_in_json()["primarySharedKey"]
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need log workspace right?
You can set --logs-destination none to avoid input not needed resource

Comment on lines 3816 to 3818
env = ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
if not env:
raise ResourceNotFoundError(f"The containerapp environment '{name}' does not exist")
Copy link
Contributor

Choose a reason for hiding this comment

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

ni: the if not env is not works when resource group not exists or environment not exists
az containerapp env premium-ingress show -n a -g b
Command group 'containerapp env premium-ingress' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
(ResourceGroupNotFound) Resource group 'b' could not be found.

az containerapp env premium-ingress show -n a -g arcenv-xinyu1-rg
Command group 'containerapp env premium-ingress' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
(ResourceNotFound) The Resource 'Microsoft.App/managedEnvironments/a' under resource group 'arcenv-xinyu1-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

g.custom_show_command('show', 'show_environment_premium_ingress')
g.custom_command('add', 'add_environment_premium_ingress')
g.custom_command('update', 'update_environment_premium_ingress')
g.custom_command('remove', 'remove_environment_premium_ingress')
Copy link
Contributor

Choose a reason for hiding this comment

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

For remove command, we should have , confirmation=True

Greedygre
Greedygre previously approved these changes May 29, 2025
Copy link
Contributor

@Greedygre Greedygre left a comment

Choose a reason for hiding this comment

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

Please fix the CI and add , confirmation=True to remove command

Tratcher added 2 commits May 29, 2025 14:52
Greedygre
Greedygre previously approved these changes May 30, 2025
@zhoxing-ms zhoxing-ms merged commit 5950b48 into Azure:main May 30, 2025
24 checks passed
bavneetsingh16 pushed a commit to AzureArcForKubernetes/k8s-extension that referenced this pull request May 30, 2025
@Tratcher Tratcher deleted the ingress-configuration-for-containerapp branch July 1, 2025 16:48
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