microsoft / microsoft/GitHub-Copilot-for-Azure
Replace deploy skill RBAC check-and-assign steps 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 **RBAC check-and-assign logic** in the `foundry-agent/deploy` skill (`deploy.md`).
## Candidate description
**RBAC check-and-assign (Step 7, and the ACR pull check in Step 3)**
The pattern is identical and repeated: list existing role assignments for an identity at a scope, check whether a specific role is present, and assign it only if missing. `az role assignment list` emits large JSON, but only a boolean (present/absent) is needed. This is deterministic, idempotent, repeated, and output-heavy — the best candidate. A script taking `(identityId, role, scope)` and printing `present`/`assigned`/`failed` would collapse a lot of fragile manual steps.
## Affected file and lines
- [`deploy.md` — Step 7: Test the Agent / RBAC check (L195–L211)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/164e0cda7b9d75d6e0d64b235d17bd7ff5e2909e/plugin/skills/microsoft-foundry/foundry-agent/deploy/deploy.md#L195-L211)
- [`deploy.md` — Step 3: ACR managed-identity pull-permission check (L132–L135)](https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/164e0cda7b9d75d6e0d64b235d17bd7ff5e2909e/plugin/skills/microsoft-foundry/foundry-agent/deploy/deploy.md#L132-L135)
## 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
Research direction
Start with deploy.md Step 7 (L195–L211) and the ACR pull-permission check in Step 3 (L132–L135), comparing the repeated az role assignment logic. Confirm the inputs and present/assigned/failed outcomes before creating both platform-specific scripts, then update the skill with linked references and examples. Run integration tests to verify the scripts and end-to-end skill flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, bash, powershell
- Domain
- cloud, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100