New Foundry Cost-Control azure cli extension - #10298
New Foundry Cost-Control azure cli extension#10298Darren Cohen (dargilco) wants to merge 18 commits into
Conversation
|
Hi Darren Cohen (@dargilco), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Foundry Cost-Control |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 10298 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The added scenario test appears to pass JSON file paths to an AAZ list argument without using the @{file} convention, which is likely to break live test execution.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Introduces a new Azure CLI extension (foundry-cost-control) that adds preview az cognitive-services account cost-control commands (create/show/list/update/delete), plus supporting docs/tests and a service mapping entry for routing/discovery.
Changes:
- Added the new
foundry-cost-controlextension package scaffolding and metadata (setup, history, docs). - Added AAZ-generated command group/command implementations for cost-control operations under
cognitive-services account cost-control. - Added a scenario test and sample rules JSON files; updated
src/service_name.jsonto include a Foundry service mapping.
File summaries
| File | Description |
|---|---|
src/service_name.json |
Registers az cognitive-services mapping for Foundry documentation routing. |
src/foundry-cost-control/setup.py |
Python packaging metadata for the new extension. |
src/foundry-cost-control/setup.cfg |
Setup configuration placeholder for the extension. |
src/foundry-cost-control/README.md |
Extension usage/readme documentation. |
src/foundry-cost-control/PostEmitter.ps1 |
Post-generation helper script (restore + api-version replacement). |
src/foundry-cost-control/HISTORY.rst |
Initial changelog entry for 1.0.0b1. |
src/foundry-cost-control/docs/UpdatesAfterGeneration.md |
Post-generation update checklist for re-emitting. |
src/foundry-cost-control/azext_foundry_cost_control/__init__.py |
Extension command loader wiring (AAZ command table load). |
src/foundry-cost-control/azext_foundry_cost_control/_help.py |
Help registration module placeholder. |
src/foundry-cost-control/azext_foundry_cost_control/_params.py |
Argument registration module placeholder. |
src/foundry-cost-control/azext_foundry_cost_control/azext_metadata.json |
Extension preview/min CLI core metadata. |
src/foundry-cost-control/azext_foundry_cost_control/commands.py |
Non-AAZ command table hook (currently empty). |
src/foundry-cost-control/azext_foundry_cost_control/custom.py |
Custom command implementation placeholder (logger only). |
src/foundry-cost-control/azext_foundry_cost_control/aaz/__init__.py |
AAZ package marker. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/__init__.py |
AAZ latest package marker. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/__init__.py |
Registers/imports the cognitive-services AAZ command group. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/__cmd_group.py |
Declares cognitive-services command group. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/__init__.py |
Registers/imports the cognitive-services account group. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/__cmd_group.py |
Declares cognitive-services account command group. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/__init__.py |
Imports cost-control subcommands. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/__cmd_group.py |
Declares cognitive-services account cost-control group. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/_create.py |
AAZ implementation for cost-control create. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/_delete.py |
AAZ implementation for cost-control delete. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/_list.py |
AAZ implementation for cost-control list (paging). |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/_show.py |
AAZ implementation for cost-control show. |
src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitive_services/account/cost_control/_update.py |
AAZ implementation for cost-control update (generic update). |
src/foundry-cost-control/azext_foundry_cost_control/tests/__init__.py |
Test package marker. |
src/foundry-cost-control/azext_foundry_cost_control/tests/latest/__init__.py |
Latest test suite marker. |
src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-1.json |
Sample rules payload (agent-based) for scenario tests. |
src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-2.json |
Sample rules payload (project-based) for scenario tests. |
src/foundry-cost-control/azext_foundry_cost_control/tests/latest/test_foundry_cost_control.py |
Live scenario test for create/list/show/update/delete flows. |
Review details
Suppressed comments (1)
src/foundry-cost-control/azext_foundry_cost_control/tests/latest/test_foundry_cost_control.py:99
- Same issue as above:
--rulesshould use@{file}so the CLI reads JSON from disk instead of trying to interpret the path string as JSON.
'--account-name {account_name} '
'--cost-control-name {cost_control_name_2} '
'--display-name "{display_name_2}" '
'--rules "{rules_file_2}"',
checks=[
- Files reviewed: 31/32 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.