azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

[Cognitiveservices] Add agent create to `az cognitiveservices` command for hosted agents: `az cognitiveservices agent create`

Open eamonoreilly opened this issue 2 months ago • 21 comments

Related command az cognitiveservices

Description Add ability to create and deploy hosted agents in AI Foundry. It enables customers to upload and build their local agent code to Azure Container Registry or point to an existing container image on ACR to use as part of the hosted agent creation. It can be used in conjunction with existing az cognitive services agent * commands to manage a hosted agent within AI Foundry.

Testing Guide

Create agent from existing container image
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image myregistry.azurecr.io/my-agent:v1.0


Create agent by building from source (auto-detect build method)
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --source ./my-agent-code \
      --registry myregistry


Create agent by building from source with custom Dockerfile name
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --source ./my-agent-code \
      --dockerfile Dockerfile.prod \
      --registry myregistry


Create agent by building remotely with ACR Task
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --source ./my-agent-code \
      --registry myregistry \
      --build-remote


Create agent with custom CPU and memory
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image myregistry.azurecr.io/my-agent:v2.0 \
      --cpu 2 \
      --memory 4Gi


Create agent with scaling configuration
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image myregistry.azurecr.io/my-agent:v1.0 \
      --min-replicas 2 \
      --max-replicas 10


Create agent with environment variables
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image myregistry.azurecr.io/my-agent:v1.0 \
      --env MODEL_NAME=gpt-4 API_TIMEOUT=30 LOG_LEVEL=info


Create agent with streaming protocol
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image myregistry.azurecr.io/my-agent:v1.0 \
      --protocol streaming \
      --protocol-version v1


Create agent using short registry name
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image my-agent:v1.0 \
      --registry myregistry


Create agent with extended timeout for large images
    az cognitiveservices agent create \
      --account-name myAccount \
      --project-name myProject \
      --name my-agent \
      --image myregistry.azurecr.io/my-large-agent:v1.0 \
      --timeout 1200

History Notes [cognitiveservices] az cognitiveservices agent create: Add ability to create and deploy hosted agent in AI Foundry


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

eamonoreilly avatar Nov 17 '25 14:11 eamonoreilly

️✔️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

Hi @eamonoreilly, Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

⚠️AzureCLI-BreakingChangeTest
⚠️cognitiveservices
rule cmd_name rule_message suggest_message
⚠️ 1001 - CmdAdd cognitiveservices agent create cmd cognitiveservices agent create added
⚠️ 1010 - ParaPropUpdate cognitiveservices agent delete cmd cognitiveservices agent delete update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent delete-deployment cmd cognitiveservices agent delete-deployment update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent list cmd cognitiveservices agent list update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent list-versions cmd cognitiveservices agent list-versions update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent show cmd cognitiveservices agent show update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent start cmd cognitiveservices agent start update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent stop cmd cognitiveservices agent stop update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']
⚠️ 1010 - ParaPropUpdate cognitiveservices agent update cmd cognitiveservices agent update update parameter project_name: updated property options from ['--project-name'] to ['--project-name', '-p']

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

yonzhan avatar Nov 17 '25 14:11 yonzhan

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[bot] avatar Nov 17 '25 14:11 github-actions[bot]

/azp run

kairu-ms avatar Nov 20 '25 05:11 kairu-ms

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Nov 20 '25 05:11 azure-pipelines[bot]

@kairu-ms , do you know if there is anything else I need to do in order to get this merged into the CLI? Please let me know if I can do anything else to help. Thanks for the help in getting this merged.

eamonoreilly avatar Dec 01 '25 19:12 eamonoreilly

Please fix CI issues

yonzhan avatar Dec 01 '25 23:12 yonzhan

/azp run

eamonoreilly avatar Dec 02 '25 16:12 eamonoreilly

Commenter does not have sufficient privileges for PR 32430 in repo Azure/azure-cli

azure-pipelines[bot] avatar Dec 02 '25 16:12 azure-pipelines[bot]

@yonzhan I updated the title of the PR. Can you run the checks again. Thanks

eamonoreilly avatar Dec 02 '25 16:12 eamonoreilly

/azp run

yonzhan avatar Dec 03 '25 00:12 yonzhan

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Dec 03 '25 00:12 azure-pipelines[bot]

@yonzhan I updated the history of the PR also to change from Adds to Add. Can you run the checks again. Thanks

eamonoreilly avatar Dec 03 '25 17:12 eamonoreilly

/azp run

yonzhan avatar Dec 04 '25 00:12 yonzhan

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Dec 04 '25 00:12 azure-pipelines[bot]

@yonzhan I seemed to have missed one check in the history. I updated History Notes to have the ticks around the command as follows [cognitiveservices] az cognitiveservices agent create: Add ability to create and deploy hosted agent in AI Foundry

Please run again. Thanks

eamonoreilly avatar Dec 04 '25 19:12 eamonoreilly

/azp run

yonzhan avatar Dec 04 '25 23:12 yonzhan

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Dec 04 '25 23:12 azure-pipelines[bot]

@yonzhan Can you let me know how I can get this merged? Thanks for the help on this. Eamon

eamonoreilly avatar Dec 08 '25 17:12 eamonoreilly

@yonzhan - Can you help with the next steps? Thanks

eamonoreilly avatar Dec 16 '25 16:12 eamonoreilly