Skip to content

{Container Apps} az containerapp function list/show: Raise clear error when ingress is disabled#10070

Open
Pulkit-Jain1 wants to merge 2 commits into
Azure:mainfrom
Pulkit-Jain1:functions-ingress-check
Open

{Container Apps} az containerapp function list/show: Raise clear error when ingress is disabled#10070
Pulkit-Jain1 wants to merge 2 commits into
Azure:mainfrom
Pulkit-Jain1:functions-ingress-check

Conversation

@Pulkit-Jain1

Copy link
Copy Markdown

Summary

az containerapp function list and az containerapp function show returned a generic InternalServerError when the target Container App (Function) had ingress disabled. The function metadata these commands read is only populated by the platform while ingress is enabled, so the underlying API fails opaquely when it is off, giving users no indication of the cause or the fix.

This change adds a pre-check that detects the disabled-ingress case (using the Container App already fetched during validation, so no extra ARM call) and raises an actionable ValidationError instead of the opaque server error.

Behavior

  • Ingress disabledIngress must be enabled to view functions for the containerapp '<name>'. Enable ingress on the container app and try again.
  • Ingress enabled → unchanged (functions list/show as before).
  • Applies to both az containerapp function list and az containerapp function show.

Changes

  • New validator validate_functionapp_ingress_enabled in _validators.py.
  • Wired into the list and show function decorators.
  • Added a scenario test (test_containerapp_function_list_show_ingress_disabled) with its recording.
  • Bumped extension version to 1.3.0b5 and added a HISTORY.rst entry.

Testing

  • Recorded the new scenario test live (AZURE_TEST_RUN_LIVE=true) and verified it passes in playback mode (offline, cassette-only).
  • Manually verified against a real ingress-disabled Container App (Function): both list and show now return the actionable error; an ingress-enabled app lists/show functions normally.

History Notes

  • az containerapp function list/show: Raise a clear error when ingress is disabled instead of a generic server error

…n ingress is disabled

`az containerapp function list` and `az containerapp function show` returned a
generic InternalServerError when the Container App's ingress was disabled,
because the function metadata is only populated by the platform while ingress
is enabled. This adds a pre-check that detects the disabled-ingress case (from
the container app already fetched during validation) and raises an actionable
ValidationError instead of the opaque server error.

- New validator `validate_functionapp_ingress_enabled` in _validators.py.
- Wired into the list and show function decorators.
- Added a scenario test covering the ingress-disabled case for list and show.
- Bumped extension version to 1.3.0b5 and added a HISTORY.rst entry.
@azure-client-tools-bot-prd

Copy link
Copy Markdown
Validation for Breaking Change Starting...

Thanks for your contribution!

@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

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

@yonzhan

yonzhan commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

containerapp

@Pulkit-Jain1 Pulkit-Jain1 marked this pull request as ready for review July 6, 2026 04:06
Copilot AI review requested due to automatic review settings July 6, 2026 04:06

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.

Pull request overview

This PR improves az containerapp function list / az containerapp function show by detecting the “ingress disabled” case up front and returning an actionable ValidationError instead of letting the underlying API fail with a generic server error. It also adds a scenario test and bumps the extension version.

Changes:

  • Add validate_functionapp_ingress_enabled and wire it into function list/show flows.
  • Add a scenario test covering ingress-disabled behavior.
  • Bump extension version and add release notes entry.

Reviewed changes

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

Show a summary per file
File Description
src/containerapp/setup.py Bumps extension version to 1.3.0b5.
src/containerapp/HISTORY.rst Adds release note for the ingress-disabled error improvement.
src/containerapp/azext_containerapp/tests/latest/test_containerapp_function.py Adds scenario test validating the new ingress-disabled error behavior.
src/containerapp/azext_containerapp/containerapp_functions_decorator.py Calls the new ingress-enabled validator for list/show.
src/containerapp/azext_containerapp/_validators.py Introduces the new ingress-enabled validator.

Comment thread src/containerapp/HISTORY.rst
Comment thread src/containerapp/setup.py Outdated
@Pulkit-Jain1

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

…on bump

- Reuse the Container App already retrieved during kind validation instead of an
  extra ARM GET in the ingress pre-check (validate_functionapp_kind now returns
  the definition; validate_functionapp_ingress_enabled accepts it).
- Revert the setup.py version bump; the changelog entry stays under 'upcoming'
  and the version is bumped at release time.
@VeryEarly VeryEarly assigned Pan-Qi and unassigned yanzhudd Jul 6, 2026
@Pan-Qi

Pan-Qi commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

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 customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants