microsoft / microsoft/GitHub-Copilot-for-Azure
Replace microsoft-foundry skill Foundry deployment enumeration with a script
- Dominant language
- Python
- Stars
- 250
- Forks
- 204
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 67
Description
## Summary
Copilot has identified a portion of a skill that is a good candidate for replacement with a script.
The candidate is the **Foundry deployment enumeration** in the `microsoft-foundry` skill (`quota/references/optimization.md`) — a gather that lists all AIServices resources and enumerates their deployments into a normalized inventory table.
## Candidate description
To inventory deployments across all Foundry resources, the skill runs a fixed gather:
1. `az cognitiveservices account list` filtered to `kind=='AIServices'` to get all resources.
2. A `jq` loop that, for each resource, runs `az ... deployment list` (in parallel background jobs) and `wait`s.
3. Print name / model / capacity / created per deployment.
This is a strong script candidate because it is:
- **Multi-step and output-heavy** — combines `account list`, `jq` parsing, a background-job loop, and `wait`, emitting large JSON of which only a few fields matter.
- **Brittle to hand-emit** — the `jq -r` + `while read` + `&` construction is easy to get wrong and has no native-Windows equivalent.
- **Partially duplicated** — the single-resource `deployment list` projection is repeated in four files (`quota.md` L117–L122, `workflows.md` L131–L136 / L151–L156, `troubleshooting.md` L199–L204).
**Sketch — `list-foundry-deployments.{sh,ps1}`:**
- **Input:** optional `--resource-group` / `--subscription` filters.
- **Output:** a single normalized inventory table (Resource / RG / Deployment / Model / Capacity / Created).
> The stale-deployment criteria (test/temp naming, >90 days, under-utilization) and the decision to delete remain agent/human judgment. The script only **gathers and presents** the inventory — it must not auto-delete.
## Affected file and lines
- [`quota/references/optimization.md` — all-resources deployment sweep (L26–L37)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/optimization.md#L26-L37)
- [`quota/quota.md` — single-resource deployment list (L117–L122)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/quota.md#L117-L122)
- [`quota/references/workflows.md` — deployment list projection (L131–L136)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/workflows.md#L131-L136)
- [`quota/references/troubleshooting.md` — deployment list projection (L199–L204)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/troubleshooting.md#L199-L204)
## Next steps
1. **Evaluate the candidate** — confirm the steps are stable and parameterizable, and that the script captures everything the skill needs.
2. **Create both a bash _and_ a PowerShell version** of the script so the skill works across platforms.
3. **Run integration tests** to verify the scripts behave correctly and the skill still completes end-to-end.
## Background Information
### Why replace regular steps with scripts
Replacing a regular, well-defined series of steps with a script can:
- **Reduce token usage** — the skill no longer needs to spell out each command and parse large command output inline; the agent invokes one script and reads a compact result.
- **Improve reliability** — the logic is written and tested once, instead of being re-derived by the agent on every run.
- **Improve determinism** — the same inputs always produce the same steps and output, removing run-to-run variation.
- **Improve speed of execution** — a single script call replaces multiple round-trips of command generation, execution, and large-output parsing.
### Authoring notes for the scripts
- **Reference scripts with markdown links**, not just a bare path to the script file.
- **Include examples** in the skill showing how to run each script (sample invocation with arguments).
- **Briefly explain what each script does** where it is referenced.
- **The script output should explain what it did**, so the agent and user can understand the result without re-inspecting raw command output.
Contributor guide
Assessment
This issue has not been assessed yet.