Skip to content

New Foundry Cost-Control azure cli extension - #10298

Open
Darren Cohen (dargilco) wants to merge 18 commits into
Azure:mainfrom
dargilco:feature/foundry-cost-control
Open

New Foundry Cost-Control azure cli extension#10298
Darren Cohen (dargilco) wants to merge 18 commits into
Azure:mainfrom
dargilco:feature/foundry-cost-control

Conversation

@dargilco

@dargilco Darren Cohen (dargilco) commented Sep 3, 2026

Copy link
Copy Markdown
Member

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

Related command

General Guidelines

  • [PASSED] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • [PASSED] Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • [IT DOES] My extension version conforms to the Extension version schema

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.json automatically.
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.

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Darren Cohen (@dargilco),
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

Foundry Cost-Control

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@dargilco

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 10298 in repo Azure/azure-cli-extensions

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@dargilco
Darren Cohen (dargilco) marked this pull request as ready for review September 9, 2026 18:19
Copilot AI lite review requested due to automatic review settings September 9, 2026 18:19
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-control extension 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.json to 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: --rules should 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.

Comment thread src/foundry-cost-control/PostEmitter.ps1
Comment thread src/foundry-cost-control/README.md Outdated
Comment thread src/foundry-cost-control/docs/UpdatesAfterGeneration.md Outdated
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@dargilco Darren Cohen (dargilco) changed the title Foundry Cost-Control azure cli extension New Foundry Cost-Control azure cli extension Sep 9, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants