-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[CognitiveServices] Add commands for container agents #32372
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
|
|
Hi @johanste, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| cognitiveservices agent | sub group cognitiveservices agent added |
|
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 adds support for hosted agent management commands to Azure Cognitive Services, enabling users to control foundry agents through the Azure CLI. The changes introduce new commands under cognitiveservices agent for starting, stopping, updating, listing, and deleting agent deployments.
Key changes:
- Added
azure-ai-projectsSDK dependency for agent data plane operations - Implemented 8 new agent management functions (update, start, stop, delete, list, etc.)
- Added client factory for AI Projects client to support agent operations
- Reformatted existing code to follow consistent style guidelines (quote style, line length)
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
setup.py |
Added azure-ai-projects~=1.0.0 dependency for agent SDK |
custom.py |
Implemented agent management functions and reformatted existing code for consistency |
commands.py |
Registered new agent command group with 8 custom commands |
_params.py |
Added argument definitions for agent commands and reformatted to use double quotes |
_help.py |
Added help documentation for new agent commands and reformatted help strings |
_client_factory.py |
Implemented cf_ai_projects factory for creating AI Projects data plane client |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def agent_update( | ||
| client, | ||
| account_name, | ||
| project_name, | ||
| agent_name, | ||
| agent_version, | ||
| min_replicas=None, | ||
| max_replicas=None, | ||
| description=None, | ||
| tags=None, | ||
| ): # pylint: disable=unused-argument |
Copilot
AI
Nov 7, 2025
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.
The description and tags parameters are defined but never used in the function body. According to the docstring, these should be used to update agent metadata, but they are not passed to _invoke_agent_container_operation. Either implement support for these parameters or remove them from the function signature and parameter definitions.
| with self.argument_context('cognitiveservices') as c: | ||
| c.argument('account_name', arg_type=name_arg_type, help='cognitive service account name', | ||
| completer=get_resource_name_completion_list('Microsoft.CognitiveServices/accounts')) |
Copilot
AI
Nov 7, 2025
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.
There is duplicate code defining 'cognitiveservices' argument context. Lines 171-221 define arguments with the new style (double quotes, proper formatting) and lines 372-390 duplicate the same arguments with the old style (single quotes). The old duplicate definitions (lines 372-477) should be removed to avoid conflicts and maintain consistency.
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.
@copilot open a new pull request to apply changes based on this feedback
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
Commands:
delete : Delete hosted agent version or all versions.
delete-deployment : Delete hosted agent deployment.
list : List hosted agent versions or deployments.
list-versions : List all versions of a hosted agent.
show : Show details of a hosted agent.
start : Start hosted agent deployment.
stop : Stop hosted agent deployment.
update : Update hosted agent deployment configuration.
Description
Add simple commands for foundry agent management
Testing Guide
History Notes
[CognitiveServices]
az cognitiveservice agent: Add command groupcommands
Commands: delete : Delete hosted agent version or all versions. delete-deployment : Delete hosted agent deployment. list : List hosted agent versions or deployments. list-versions : List all versions of a hosted agent. show : Show details of a hosted agent. start : Start hosted agent deployment. stop : Stop hosted agent deployment. update : Update hosted agent deployment configuration.This 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.