-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Cognitive Services] az cognitiveservices account [project|connection]: Add support for AI Foundry project and connection management
#32336
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
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @CarlOchs, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| cognitiveservices account connection | sub group cognitiveservices account connection added |
||
| cognitiveservices account deployment create | cmd cognitiveservices account deployment create added parameter spillover_deployment_name |
||
| cognitiveservices account project | sub group cognitiveservices account project 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 comprehensive support for managing AI Foundry resources within Azure Cognitive Services accounts, including projects, account-level connections, and project-scoped connections. The implementation upgrades the SDK version and introduces new command groups to handle these resources through the Azure CLI.
Key Changes
- Upgraded azure-mgmt-cognitiveservices from 13.7.0 to 14.1.0 to access new API features
- Added three command groups:
account project,account connection, andaccount project connection - Implemented connection loading utilities that support both YAML and JSON formats
Reviewed Changes
Copilot reviewed 54 out of 55 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py, requirements.*.txt | SDK version update to 14.1.0 |
| custom.py | Core logic for project and connection CRUD operations |
| commands.py | Command registration for new resource types |
| _utils.py | Connection parsing and identity composition utilities |
| _ml_utils.py | ML connection type mapping for compatibility |
| _params.py | Parameter definitions and validators |
| _help.py | Documentation for new commands |
| _client_factory.py | Client factory methods for new operations |
| test_.py, input_data/ | Test files and fixtures |
| linter_exclusions.yml | Test coverage exclusion configuration |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/cognitiveservices/_ml_utils.py:1
- Remove the space between the period and underscore in the import statement. Should be
from ._ml_utils import
from azure.cli.core.azclierror import FileOperationError, InvalidArgumentValueError
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/cognitiveservices/_help.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/cognitiveservices/_help.py
Outdated
Show resolved
Hide resolved
| 'cognitiveservices account project connection', project_connections_type, | ||
| client_factory=cf_project_connections) as g: | ||
| g.custom_command('create', 'project_connection_create') | ||
| g.command('delete', 'delete') |
Copilot
AI
Oct 27, 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 delete command for project connections should include confirmation=True to prompt users before removing resources, as deletions are destructive operations.
| 'cognitiveservices account project', projects_type, | ||
| client_factory=cf_projects) as g: | ||
| g.custom_command('create', 'project_create') | ||
| g.command('delete', 'begin_delete') |
Copilot
AI
Oct 27, 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 delete command for projects should include confirmation=True to prompt users before removing resources, as deletions are destructive operations.
| 'cognitiveservices account connection', account_connections_type, | ||
| client_factory=cf_account_connections) as g: | ||
| g.custom_command('create', 'account_connection_create') | ||
| g.command('delete', 'delete') |
Copilot
AI
Oct 27, 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 delete command for account connections should include confirmation=True to prompt users before removing resources, as deletions are destructive operations.
| help=('Use with --user-assigned-identity to generate and assign a ' | ||
| 'system managed Azure Active Directory Identity for this project.')) |
Copilot
AI
Oct 27, 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 help text starts with 'Use' which is not in the active voice first person. Consider rephrasing to start with an active first-person verb like 'Generate' or 'Assign'.
|
|
||
| class CognitiveServicesProjectConnectionsTests(ScenarioTest): | ||
|
|
||
| INPUT_DATA_PATH=os.path.join(TEST_DIR, 'input_data', 'connections') |
Copilot
AI
Oct 27, 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.
Class attribute INPUT_DATA_PATH should use lowercase with underscores according to Python naming conventions (should be input_data_path).
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@kairu-ms Thanks for the review - I had to re-generate all the recording files to get the tests to not fail. I'm not exactly sure why yet, but it fixed it. Will we be able to get this PR into the release coinciding with Ignite? |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 32336 in repo Azure/azure-cli |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
az cognitiveservices account connection [create|update|show|list|delete]az cognitiveservices account project [create|update|show|list|delete]az cognitiveservices account project connection [create|update|show|list|delete]Description
This PR adds support for the following Cognitive Services Account sub-resource types:
Testing Guide
History Notes
[Cognitive Services]
az cognitiveservices account connection: Add AI Foundry account connection management[Cognitive Services]
az cognitiveservices account project: Add AI Foundry account project management[Cognitive Services]
az cognitiveservices account project connection: Add AI Foundry account project connection managementThis 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.