Skip to content

Conversation

@khushishah513
Copy link
Contributor


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

Related command

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

For new extensions:

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 November 12, 2025 13:15
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Nov 12, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd containerapp debug cmd containerapp debug added parameter debug_command
⚠️ 1011 - SubgroupAdd containerapp function sub group containerapp function added

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

Hi @khushishah513,
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 Nov 12, 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>

@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
Copy link

Hi @khushishah513

Release Suggestions

Module: containerapp

  • Update VERSION to 1.2.0b6 in src/containerapp/setup.py

Notes

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 introduces comprehensive support for Azure Functions on Container Apps, including commands for managing functions, function keys, and invocation monitoring. The PR adds new commands for listing/showing functions, managing function keys, and retrieving invocation telemetry from Application Insights.

Key Changes

  • Added new containerapp function commands for listing and showing functions
  • Implemented function keys management (show, list, set operations)
  • Added function invocations monitoring (summary and traces from App Insights)
  • Enhanced the debug command to support executing commands inside containers
  • Created new decorator classes for functions and function keys operations

Reviewed Changes

Copilot reviewed 15 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
custom.py Added command implementations for function operations and debug command enhancement
containerapp_functions_decorator.py New decorator classes for function list/show/invocations operations
containerapp_function_keys_decorator.py New decorator classes for function keys operations
containerapp_debug_command_decorator.py New decorator for executing commands in containers
_validators.py Added validation functions for function app operations
_utils.py Added utility functions for replica selection and command execution
commands.py Registered new command groups and transformers
test_containerapp_function.py Comprehensive test suite for function operations
utils.py Added helper for v1 environment preparation

# --------------------------------------------------------------------------------------------

from subprocess import run
from time import sleep
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The imports include both subprocess.run and time.sleep, but the code uses time.sleep throughout instead of the imported sleep. Either use the imported sleep or remove the from time import sleep import to be consistent.

Suggested change
from time import sleep

Copilot uses AI. Check for mistakes.
container_app_name=name
)

if revision_name and revision_name is not None:
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The condition if revision_name and revision_name is not None: is redundant. If revision_name is truthy, it's already not None. Simplify to just if revision_name: for better readability.

Copilot uses AI. Check for mistakes.


def get_random_replica(cmd, resource_group_name, container_app_name, revision_name):
logger.debug(f"Getting random replica for container app: name='{container_app_name}', resource_group='{resource_group_name}', revision='{revision_name}'")
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The function is named get_random_replica but actually selects the replica with the latest creation time (line 867), not a random one. Consider renaming to get_latest_replica or get_running_replica to accurately reflect the behavior.

Copilot uses AI. Check for mistakes.
container_app_name=name
)

if revision_name and revision_name is not None:
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The same redundant condition appears on line 148. Simplify to if revision_name: for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to 19
import random

Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The random module is imported but never used in the code. Remove this unused import.

Suggested change
import random

Copilot uses AI. Check for mistakes.
Comment on lines +142 to +143
# Test: Show functions with non-existent revision should fail
with self.assertRaisesRegex(Exception, ".*"):
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

[nitpick] Missing blank line before comment (PEP 8 style). Add a blank line before line 142 to improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to 30
debug_url = (f"wss://{proxy_api_url}/subscriptions/{sub}/resourceGroups/{resource_group_name}/"
f"containerApps/{name}/revisions/{revision}/replicas/{replica}/debug"
f"?targetContainer={container}")
return debug_url


Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

[nitpick] The URL construction now splits the path across three lines with a trailing slash in the first line. This improves readability but introduces an unnecessary intermediate variable. Consider keeping the original inline return or adjusting line breaks to align with other URL constructions in the codebase.

Suggested change
debug_url = (f"wss://{proxy_api_url}/subscriptions/{sub}/resourceGroups/{resource_group_name}/"
f"containerApps/{name}/revisions/{revision}/replicas/{replica}/debug"
f"?targetContainer={container}")
return debug_url
return (f"wss://{proxy_api_url}/subscriptions/{sub}/resourceGroups/{resource_group_name}/"
f"containerApps/{name}/revisions/{revision}/replicas/{replica}/debug"
f"?targetContainer={container}")

Copilot uses AI. Check for mistakes.
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.

3 participants