microsoft / microsoft/GitHub-Copilot-for-Azure

Replace microsoft-foundry skill multi-region quota sweep with a script

Open
#2,526 1 comment 0 reactions 1 assignee Claimed by @tmeschter View on GitHub
microsoft-foundry skills untriaged
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 **multi-region quota sweep** in the `microsoft-foundry` skill (`quota/`) — the regional usage probe wrapped in a `for region` loop to find a region with available capacity, which appears in three divergent forms (sequential, parallel, rebalance).

## Candidate description

The "find a region with capacity" workflow loops the single-region usage probe across a candidate region list:

1. For each region in a candidate set, run `az rest --method GET ...//usages`.
2. Compute `Available = limit − currentValue` per region.
3. Print a per-region block (`echo "=== ==="`) and pick the region(s) with the most Available.

This is a strong script candidate because it is:
- **Implemented three different ways** — a sequential `for region in (...)` loop, a parallelized `&`…`wait` variant, and a rebalancing variant — exactly the accidental divergence a single script eliminates.
- **Brittle by hand** — the parallel `&`/`wait` bash idiom has no native-Windows equivalent and is error-prone to emit inline.
- **Output-reducing** — collapses N noisy per-region outputs into one consolidated, sorted table that highlights the best region.

**Sketch — `sweep-foundry-quota.{sh,ps1}`:**
- **Input:** `--regions` (comma-separated; sensible default set), `--model-filter`, `--sku`.
- **Output:** one consolidated table sorted by Available, highlighting the region(s) with the most capacity.

> Choosing the candidate region set and the final deployment-target decision stay in prose. The "Available < 10% → pick a different region" rubric remains prose guidance. The script handles only the mechanical sweep + ranking.

**Note — cross-skill overlap:** Like the single-region probe, this sweep likely overlaps the separate `azure-quotas` skill; build it as a shared asset (the single-region and multi-region modes are naturally one tool).

## Affected file and lines

- [`quota/references/workflows.md` — sequential region sweep (L18–L32)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/workflows.md#L18-L32)
- [`quota/references/workflows.md` — sweep variant (L111–L123)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/workflows.md#L111-L123)
- [`quota/references/error-resolution.md` — parallel `&`/`wait` sweep (L8–L14)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/error-resolution.md#L8-L14)
- [`quota/references/optimization.md` — rebalance sweep (L157–L166)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/microsoft-foundry/quota/references/optimization.md#L157-L166)

## 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.