SQL Migration Advisor
A GitHub Copilot skill that helps an agent produce a provisional SQL Server to Azure migration assessment, grounded in a tested prompt policy and version-gated knowledge base.
A GitHub Copilot skill named recommend-migration-path that helps a Copilot agent produce a
provisional SQL Server → Azure migration assessment. It runs a guided interview, applies a prompt policy
under regression test, checks its own draft before rendering, and returns a preliminary recommendation for
assessment: primary path, best alternative, exclusions, confidence, evidence required, downtime, blockers,
cost levers, and the right Microsoft program. It is backed by a verified knowledge base and
version-gated freshness automation.
What it is
The advisor is a self-contained skill at skills/recommend-migration-path/SKILL.md. It travels with
reference documents that define the accepted inputs, the output shape and the rule set, and with
schemas/input.schema.json and schemas/output.schema.json, which state the same two contracts in a
form a machine can check — the recommendation object is consumed by a second skill, and a handoff
described only in prose cannot fail a test. Clone the whole
repository into a Copilot skills location; installing only SKILL.md breaks the relative links to
reference/input-contract.md, reference/decision-rules.md and reference/output-contract.md. No
fine-tuning or external service sits in the decision path. It is:
- Grounded — every recommendation is traceable to a verified knowledge base, not model memory.
- Prompt policy under regression test — Phase A filters hard eligibility, then Phase B ranks viable paths and tiers. A JavaScript mirror replays 118 scenarios through those rules on every commit; the agent reading them in a session is not that mirror.
- Explicit about uncertainty — outputs carry
provisionalstatus,lowormediumconfidence, assumptions, unknowns, blockers and evidence required. - Freshness-gated — consistency checks, link classification and a claims registry prevent unearned version bumps.
- Self-checked before display — the skill rereads its draft against the output contract, so contradictions are exposed instead of hidden.
- Honest about limits — it is a discovery and pre-selection assistant. Assessment tooling and architect sign-off remain mandatory.
Install
Clone the repository, not a single file, because the skill reads reference documents beside it. The skill
name is recommend-migration-path and its entry point is
skills\recommend-migration-path\SKILL.md.
git clone https://github.com/fredgis/sql-migration-advisor.git $env:USERPROFILE\.copilot\skills\sql-migration-advisor
Do not clone into an assessment-advisor folder for v2. That was the old skill name, and it hides the fact
that the new skill depends on reference\input-contract.md, reference\decision-rules.md and
reference\output-contract.md at the repository root.
Architecture
The skill is just files in a repo: skills/recommend-migration-path/SKILL.md, a knowledge base, two
contracts, decision rules, worked examples, a claims registry, golden tests, and a weekly freshness Action.
The agent reads them at runtime.
Explore the rules
Open the interactive rule graph →Three views over the same policy: the documented paths to each target, the 31 addressable rules with the fields each one consumes, and the coverage of the 118 scenarios replayed on every commit. Select a node to isolate its relations.
Enumerating the profiles literally is not an option — more than 13.9 billion combinations before the conditional fields, and free-text fields make the space unbounded — so the graph shows the relations in compressed form instead.
How the agent uses it
When a user asks for a migration recommendation, the agent loads recommend-migration-path, runs Tier 1
triage and Tier 2 confirmation questions, applies Phase A eligibility and Phase B ranking, runs the
self-check, and produces a grounded preliminary recommendation. The card includes the primary path, best
alternative, exclusions, confidence, assumptions, unknowns and evidence required. The agent can still build
a context-aware plan, but every factual claim is anchored to the knowledge base rather than invented.
How a recommendation is decided
This is the runtime path — it runs per conversation, when someone asks. There is no schedule: the user asks, the interview runs, and the decision is made in two distinct phases.
- Phase A — eligibility applies only hard constraints and labels each target
eligible,eligible_with_remediation,unsupportedorunknown_requires_assessment. A decision-driving unknown never silently defaults. - Phase B — ranking applies ten ordered steps. It respects the requested management model, then compares refactoring effort, downtime fit, operational burden, reversibility, sovereignty, cost levers only when the inputs exist, and unresolved assumptions. If candidates still tie, the card returns a provisional shortlist instead of inventing a winner.
- The self-check rereads the draft against 16 invariants before the user sees it. A method must be
available for the target, unsupported targets cannot appear as recommendations, unknown hard gates must be
visible, and status must remain
provisionalwith confidence no higher thanmedium. If an invariant fails, the skill must expose the inconsistency rather than silently repair it. - Rule IDs appear in the eligibility trace, such as
MI-LINK-HOSTorFILESTREAM-PAAS. They point to the rule index inreference/decision-rules.md, so a reader can look up the exact rule and challenge it.
The interview
Two tiers. Tier 1 always produces a provisional recommendation; Tier 2 is asked only when an answer can still change the outcome. Questions come one at a time, in your language. “Not sure” is allowed — but a decision-driving unknown is never silently defaulted: it forces a provisional status plus an explicit evidence gap.
Tier 1 — Triage
The middle column is the question as the agent actually asks it.
| # | The agent asks | Answer options | What it drives |
|---|---|---|---|
| 1 | “How big is this migration?” | Single database · A few (2–10) · Large estate (10+) | Large estate ⇒ Azure Migrate discovery first |
| 2 | “Where does the source SQL Server run today?” | On-prem · AWS EC2 · AWS RDS · GCP Compute Engine · GCP Cloud SQL | Managed sources ⇒ MI Link and replication are out |
| 3 | “Which SQL Server version is the source?” | 2008/R2 · 2012 · 2014 · 2016 · 2017/2019 · 2022 · 2025 | MI Link, LRS, native restore, replication, ESU |
| 4 | “What outcome do you need now?” | Move now · Modernize in place (assess first) · Assessment only · Rehost first | Opens the Arc in-place path |
| 5 | “What is the main reason to migrate now?” | End-of-support/ESU · Cost · App modernization · Data-center exit · Analytics/Fabric · Sovereignty | Target bias and the Fabric branch |
| 6 | “How much control do you need over the engine and OS?” | Fully managed PaaS · OS/engine control · Kubernetes on-prem/edge | PaaS vs IaaS vs Kubernetes |
| 6a | ↳ “Do you want Microsoft to run the engine on your cluster, or own it end to end?” (if Q6 = Kubernetes) | Managed engine (Arc data controller) · Full DIY container | Arc-enabled SQL MI vs container |
| 7 | “Do you know which SQL Server features the workload uses?” | None of them, confirmed · Let me list them · Not checked yet | Names the intent before asking for the list, so “none” and “not checked” never collapse |
| 7a | ↳ “List the ones it uses, separated by commas.” (free text, after “Let me list them”) | FILESTREAM/FileTable · PolyBase · DTC · Cross-DB · SQL CLR · Linked servers · SQL Agent · Service Broker | Phase A eligibility |
| 7b | ↳ “What does PolyBase actually query — files in cloud storage, or an external database like Oracle?” (if PolyBase) | Cloud files only (Blob/ADLS, Parquet/CSV) · External RDBMS connector · S3/Delta/pushdown · Not sure | Cloud files ⇒ SQL MI stays eligible |
| 7c | ↳ “Are those distributed transactions only between SQL Servers, or do they span a non-SQL database?” (if DTC) | SQL-to-SQL only · Heterogeneous / third-party RDBMS · Not sure | SQL-to-SQL ⇒ SQL MI stays eligible |
| 8 | “How large is the biggest database?” | < 150 GB · 150 GB – 4 TB · > 4 TB · > 128 TB · Not sure | Hyperscale ceiling, backup caps, seeding |
| 9 | “How much cutover downtime can the business accept?” | Near-zero (minutes) · Minimal (tens of minutes to hours) · Offline window · Not sure | Method selection, downtime class |
| 10 | “What is the network path to Azure, and can MI Link ports 5022 and 11000–11999 be opened in the required directions?” | Good ExpressRoute · Ports confirmed open in both directions · Limited WAN · Multi-TB · 5022 or 11000–11999 blocked · 1433/443 blocked · Not sure | MI Link viability, Data Box seeding |
| 11 | “Any data residency, sovereign, or edge constraints?” | Standard · EU data boundary · Government/sovereign · Edge/air-gapped · Not sure | Biases SQL VM, AVS, Arc SQL MI |
| 12 | “Anything around the database to bring along?” | Nothing, confirmed · Let me list them · Not sure | Names the intent before asking for the list |
| 12a | ↳ “List them, separated by commas.” (free text) | SSIS · SSRS · SSAS · TDE · Many SQL Agent jobs · Windows logins | Blockers and remediations |
| 13 | “Any tier drivers?” (when SQL MI or SQL DB is still eligible) | No particular driver, confirmed · Let me list them · Not sure | “Not sure” holds the tier at unknown_requires_assessment instead of defaulting to GP |
| 13a | ↳ “List them, separated by commas.” (free text) | Low-latency writes · High IOPS/log throughput · Strict SLA · Read-scale replicas · Intermittent usage · Many tenants | GP vs Business Critical vs Hyperscale vs Serverless vs Elastic Pool |
What a real exchange looks like
Agent — How big is this migration?
User — A few databases, maybe 6.Agent — Where does the source SQL Server run today?
User — AWS RDS for SQL Server.The agent notes: managed source, so MI Link and transactional replication are already out.
Agent — Which SQL Server version is the source?
User — 2019.Agent — Do you know which SQL Server features the workload uses: FILESTREAM/FileTable, PolyBase, DTC, cross-DB queries, SQL CLR, linked servers, SQL Agent jobs, Service Broker?
User — Let me list them.Agent — List the ones it uses, separated by commas.
User — SQL Agent jobs, and we do use distributed transactions.Agent — Are those distributed transactions only between SQL Servers, or do they span a non-SQL database?
User — Only SQL to SQL.SQL MI stays eligible. This is exactly the question that used to be missing — and its absence wrongly eliminated SQL MI.
Agent — How much cutover downtime can the business accept?
User — A couple of hours is fine.
From here the agent has enough for a provisional recommendation, and only asks the Tier 2 questions that could still change it.
Tier 2 — Confirmation
Asked only when it can still change the answer:
- Source edition and OS · compatibility level
- Current HA/DR topology (FCI, AG, log shipping, none)
- RPO and RTO, separately
- Peak log generation and change rate
- CPU, memory, IOPS and latency peaks
- Authentication model (Windows / Entra ID / SQL)
- SQL CLR permission set (
SAFE/EXTERNAL_ACCESS/UNSAFE) - Network, DNS and Active Directory dependencies
- Backup retention and restore requirements
- Target region and real feature availability there
- DR architecture and rollback plan
- Software Assurance / AHB entitlement
- Maintenance and patching restrictions
Structured inputs
Four values are captured as typed data rather than prose, because the rules read them directly and a
wrong guess silently changes the recommendation. The stable fields and option IDs live in
reference/input-contract.md. That contract keeps NONE_CONFIRMED, UNKNOWN and NOT_APPLICABLE separate, because “there are none” and “nobody checked” lead to different assessments:
| Field | Asked when | Consumed by |
|---|---|---|
database_count (integer) |
more than one database is in scope | MI Link capacity (100 GP/BC, 500 Next-gen GP) and estate discovery — never inferred from a free-text size answer |
migration_batch_size (integer) |
the Azure Arc portal migration is used | the Arc wizard per-batch limit — a different limit from MI Link capacity |
arc_extension_version |
the Azure Arc portal migration is used | gates the Arc wizard batch limit; unknown is not treated as recent |
evidence (4 booleans) |
the user reports that an assessment was run | recorded as claims to verify elsewhere; they never raise the status above provisional or confidence above medium |
The canonical list lives in reference/input-contract.md.
The output fields, allowed status vocabulary and 16 self-check invariants live in
reference/output-contract.md.
Weekly knowledge-base automation
A scheduled GitHub Action first checks version consistency, classifies links as ok, unreachable or unverified-bot-blocked, scans Microsoft news, and verifies high-risk claims against a claims registry. A model review then summarizes potential drift, but a version bump is allowed only when substantive content changes were actually applied; otherwise the run is housekeeping or report-only. Freshness becomes a routine, reviewable event.
The review runs on an Azure AI Foundry model deployment, at the deepest reasoning setting available — it is a whole-corpus pass over both the knowledge base and the decision tree. The prompt holds it to precision beats recall: a finding without a Microsoft source URL is not reported, and it answers with structured findings — file, locator, current text, correction, source, confidence — so a reviewer can check the cited page instead of guessing what was meant. Authentication is Entra ID through GitHub OIDC: no API key, no stored client secret, just a federated credential scoped to this repository. If the model is unavailable, the step is skipped and every scripted check still runs: an advisory verdict can never, on its own, change a version.
Why the overhaul matters
External audits found accuracy, traceability and freshness gaps. The response was concrete: the knowledge base corrected hard facts, the input contract stops labels drifting away from rules, the output contract limits status and confidence, ranking is ordered, and the card cites rule IDs. The result is easier to challenge, which is the point.
How the rules are kept correct
This one is not a runtime path — it is the quality gate, and it runs on every push and every pull request. (It is separate from the weekly knowledge-base check above, which runs Mondays at 05 UTC.)
- One source of constants. Ports, capacities, version floors and thresholds live in
decision-rules.data.json. The engine holds no hard-coded numbers. - Drift is caught.
check-rules-data.mjsverifies 187 constants against the markdown prose, in strict mode — a warning fails the build. - Decisions are tested. 118 golden scenarios are replayed through the engine and compared field by field. Break a rule and the suite fails, naming the scenario.
- Twenty gates run. The suite checks scenario shape, output consistency, contract wiring, the rule index, retired tooling, forbidden regressions and the weekly consistency script.
- Honest limit. Constants are single-sourced, but rule logic still exists twice: prose for the agent, JavaScript for the tests.
Roadmap — from an advisor to a migration platform
This is deliberately ambitious. sql-migration-advisor is the first of three grounded, Copilot-native
building blocks. The advisor tells you where to land and how; the next two are meant to help you measure
and then execute the move — so a practitioner can go from “I have a SQL Server estate” to “it’s running on
Azure” without ever leaving Copilot.
Colour code: green = shipped, amber = planned. HVE Core is green but only partially wired in today.
The three building blocks
- Advisor — shipped. This repo. It interviews the user, filters eligibility, ranks viable paths, and returns a grounded preliminary recommendation.
- Assessment — planned. A skill/agent that reads the actual estate (versions, sizes, feature dependencies, blockers) and turns the advisor’s recommendation into a sized, evidence-backed plan.
- Migration — planned. A skill/agent that executes and validates the move (orchestration, cutover, post-migration checks), keeping a human in control at every gate.
Integrating into HVE Core
The intent is to contribute these building blocks to HVE Core — Microsoft’s Hypervelocity Engineering library of Copilot agents, prompts, coding instructions, and reviewed skills. HVE Core ships as a VS Code extension and a Copilot CLI plugin, so a skill packaged its way becomes installable by any team in a single step. Integration is partial today — the advisor is furthest along; wiring all three in is the work ahead.
One concrete integration vehicle is Squad — Brady Gaster’s “human-led AI agent teams” for GitHub Copilot — a natural way to orchestrate the advisor → assessment → migration hand-off with a human accountable throughout. It is alpha, and one option among others.
See it in action — the video below is the shipped advisor today. The roadmap extends this same grounded, human-in-the-loop pattern to assessment and migration, orchestrated (for example) by a Squad-style team.
Roadmap steps
- Ship + document the advisor (done). This repo, its knowledge base, the weekly freshness Action, and the implementer guide.
- Package the advisor for HVE Core. A collection entry that follows HVE Core conventions and installs as a Copilot CLI plugin / VS Code extension.
- Design the Assessment skill. Define its knowledge base, interview, and evidence outputs; reuse the prompt-policy + freshness pattern.
- Build the Assessment skill/agent. Take the advisor’s recommendation and produce a sized, blocker-aware plan grounded in the scanned estate.
- Design the Migration skill. Orchestration steps, cutover gates, and validation checks — with explicit human approval at every gate.
- Build the Migration skill/agent. Execute against the assessment output and validate the result.
- Orchestrate the three together. Wire advisor → assessment → migration into one flow (for example via a Squad-style team) and contribute the set to HVE Core.
- Close the loop. Shared knowledge base and weekly freshness across all three blocks, plus telemetry to keep the recommendations sharp.
Yes, it’s ambitious — three grounded skills, a shared freshness discipline, and a clean integration into a Microsoft-owned platform. But each piece is small, reviewable, and useful on its own, and the advisor already proves the pattern works end to end.
Learn more
- How the skill works — the full implementer guide.
SKILL.md— therecommend-migration-pathskill contract and questionnaire.- Input contract — stable option IDs, canonical fields and unknown handling.
- Output contract — status vocabulary and self-check invariants.
- Decision rules — the rule policy and addressable rule index.
- Knowledge base — the verified source of truth.