Skip to content

Conversation

@johanste
Copy link
Member

@johanste johanste commented Nov 4, 2025

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 group

commands

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.

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

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

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

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

Hi @johanste,
Since the current milestone time is less than 7 days, this pr may not catch up with this release.

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

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

⚠️AzureCLI-BreakingChangeTest
⚠️cognitiveservices
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd cognitiveservices agent sub group cognitiveservices agent added

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 4, 2025

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

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

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>

@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Nov 4, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Cognitive Services az cognitiveservices label Nov 4, 2025
@johanste johanste changed the title Agentcommands [CognitiveServices] Add commands for container agents Nov 4, 2025
@johanste johanste marked this pull request as ready for review November 7, 2025 01:16
Copilot AI review requested due to automatic review settings November 7, 2025 01:16
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 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-projects SDK 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.

Comment on lines +445 to +455
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
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines 372 to 374
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'))
Copy link

Copilot AI Nov 7, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

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

@kairu-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@kairu-ms kairu-ms merged commit c9e6351 into Azure:dev Nov 10, 2025
53 of 54 checks passed
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 Cognitive Services az cognitiveservices

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants