[Cognitiveservices] Add agent create to `az cognitiveservices` command for hosted agents: `az cognitiveservices agent create`
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.
-
[x] The PR title and description has followed the guideline in Submitting Pull Requests.
-
[x] I adhere to the Command Guidelines.
-
[x] I adhere to the Error Handling Guidelines.
️✔️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 createadded⚠️ 1010 - ParaPropUpdate cognitiveservices agent delete cmd cognitiveservices agent deleteupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent delete-deployment cmd cognitiveservices agent delete-deploymentupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent list cmd cognitiveservices agent listupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent list-versions cmd cognitiveservices agent list-versionsupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent show cmd cognitiveservices agent showupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent start cmd cognitiveservices agent startupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent stop cmd cognitiveservices agent stopupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']⚠️ 1010 - ParaPropUpdate cognitiveservices agent update cmd cognitiveservices agent updateupdate parameterproject_name: updated propertyoptionsfrom['--project-name']to['--project-name', '-p']
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). 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>
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@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.
Please fix CI issues
/azp run
Commenter does not have sufficient privileges for PR 32430 in repo Azure/azure-cli
@yonzhan I updated the title of the PR. Can you run the checks again. Thanks
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@yonzhan I updated the history of the PR also to change from Adds to Add. Can you run the checks again. Thanks
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@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
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@yonzhan Can you let me know how I can get this merged? Thanks for the help on this. Eamon
@yonzhan - Can you help with the next steps? Thanks