microsoft / microsoft/GitHub-Copilot-for-Azure
Replace azure-deploy skill deployment verification and endpoint reporting 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 **deployment verification and endpoint reporting flow** in the `azure-deploy` skill — a fixed, read-only "list resources, health-check the endpoint, extract the URL, and report it as `https://`" sequence that is duplicated across all five deployment recipes.
## Candidate description
Every recipe's `verify.md` ends a deployment by running the same deterministic verification-and-report sequence:
1. `az resource list -g -o table` (or `terraform output` / `az deployment sub show ... properties.outputs`) to enumerate what was deployed.
2. Extract the service endpoint/FQDN with a fixed `--query ... -o tsv` (or grep over `SERVICE_*_URI` / `*_ENDPOINT`).
3. `curl -s https:///health | jq .` to probe health.
4. Unconditionally prepend `https://` before presenting the URL to the user.
This is a strong script candidate because it is:
- **Heavily duplicated** — the same resource-list + `/health` curl + endpoint-extraction + "always prepend `https://`" pattern recurs verbatim across all four recipe `verify.md` files plus the AZD `post-deployment.md`. The azcli copy already ships parallel bash **and** PowerShell blocks, proving it is mechanical.
- **A fixed, read-only sequence** with no branching — pure data gathering and formatting.
- **Output-heavy** — `az resource list` and the health probe emit large blobs; only the endpoint URL and the health status actually matter. The recurring, error-prone "always prepend `https://`" instruction is exactly the kind of normalization a script does once, correctly.
**Sketch — `verify-deployment.{sh,ps1}`:**
- **Input:** `-g/--resource-group`, optional service type/name (or `--from-azd-env` / terraform/bicep outputs), optional `--health-path` (default `/health`).
- **Output:** a single labeled digest — deployed resources, each service's normalized `https://` URL, and its health-probe status code/body — so the agent gets one summarized, ready-to-present result instead of parsing several raw command dumps.
> Deciding which service type(s) were deployed, interpreting an unhealthy/slow-start response (wait-and-retry vs. investigate), and the mandatory act of presenting the URLs in the response stay in prose. The script only **gathers, normalizes, and digests**.
## Affected file and lines
- [`references/recipes/azd/verify.md` — endpoint extraction + health check (L21–L51)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/azure-deploy/references/recipes/azd/verify.md#L21-L51)
- [`references/recipes/azd/post-deployment.md` — verify endpoints (L74–L96)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/azure-deploy/references/recipes/azd/post-deployment.md#L74-L96)
- [`references/recipes/terraform/verify.md` — resource list + health + endpoints (L3–L30)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/azure-deploy/references/recipes/terraform/verify.md#L3-L30)
- [`references/recipes/cicd/verify.md` — resource list + health + report (L9–L23)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/azure-deploy/references/recipes/cicd/verify.md#L9-L23)
- [`references/recipes/azcli/verify.md` — resource list + health + endpoint extraction (L3–L67)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/azure-deploy/references/recipes/azcli/verify.md#L3-L67)
- [`references/recipes/bicep/verify.md` — resource list + outputs + health + report (L3–L31)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/3890cbfb65c548ce8daa96cabd1d8de63f7bbcca/plugin/skills/azure-deploy/references/recipes/bicep/verify.md#L3-L31)
## 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.