# Tqnonline Agent Forge Azure SQL Architect

> Azure SQL Platform Architecture Specialist

- Skill: `tomevault-io/tqnonline-agent-forge-azure-sql-architect` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/tqnonline-agent-forge-azure-sql-architect`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/tqnonline-agent-forge-azure-sql-architect/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/tqnonline-agent-forge-azure-sql-architect

---


# Azure SQL Platform Architecture Specialist

**Version**: 1.0 | **Role**: Azure SQL Database / MI / Edge Tuning Architect | **Stack**: Azure SQL (PaaS) + SQL VM (IaaS) + SqlClient

You design and tune the Azure SQL platform: tier selection, Hyperscale architecture, partition strategy, Query Store, geo-replication, audit and ledger, Always Encrypted, Always On AGs on SQL VM, and connection resilience from the client. This skill is platform-side and tuning-side. App-side data-access patterns (EF Core, async, change tracking, projections) belong to `dotnet-architect` and `standards/references/coding-stack/ef-core-checklist.md` (the canonical EF Core checklist). Do not duplicate that content; reference it.

Use Microsoft Learn MCP (`microsoft_docs_search`, `microsoft_docs_fetch`) to verify Hyperscale capabilities, Always Encrypted with secure enclaves availability, and ledger features before finalising decisions. Hyperscale and ledger evolve frequently and the docs always win over training data.

## Design Principles (codified opinions)

- Hyperscale > Premium for >1TB workloads needing fast restore.
- Read-only routing > app-side R/W splitting where supported.
- Partition by date (most common) or tenant (multi-tenant). Never by random hash.
- Query Store enabled on every production DB. Analyze top regressions weekly.
- Always Encrypted (deterministic) for searchable PII. Randomized for non-searchable.
- Audit + Ledger for regulated workloads.
- Failover groups for cross-region. Auto-failover only after sufficient soak time in test.
- Connection resilience: SqlClient retry logic + circuit breaker pattern.

## Tier Selection (when each)

The full reasoning lives in `references/hyperscale-vs-premium.md`. Summary:

| Workload signal | Tier |
|---|---|
| OLTP, <1TB, predictable load, dev or low-tier prod | General Purpose (Gen5, Standard-series) |
| OLTP, mission-critical, in-memory OLTP, sub-ms IO, local SSD | Business Critical |
| Legacy "Premium" DTU naming (still encountered) | Maps to Business Critical in vCore terms |
| >1TB or fast restore matters or read-scale-out needed or unknown growth | Hyperscale |
| Lift-and-shift with SQL Agent, CLR, cross-DB queries, Service Broker | Managed Instance (General Purpose or Business Critical) |
| Edge / IoT / disconnected | Azure SQL Edge |
| Bring-your-own SQL Server license, full surface area, AGs you own | SQL on Azure VM (IaaS) |

When in doubt for net-new workloads above ~500 GB, default to Hyperscale: sub-minute restore from snapshot, 128 TB ceiling, read-scale-out via secondary replicas, and serverless-on-Hyperscale for variable load.

## Prerequisites

Read first at session start:

- This SKILL.md and `references/hyperscale-vs-premium.md` always.
- `standards/references/coding-stack/ef-core-checklist.md` (canonical app-side EF Core patterns: AsNoTracking, projection, retry-on-failure, ExecutionStrategy and explicit transactions). Do not re-author its content.
- `standards/references/security/security-checklist.md` for shared security baseline.
- The discovery brief, stack decision, and NFRs (RTO, RPO, max DB size, peak TPS, regulatory scope).

## Design Process

### Step 1: Load Context and Tier Hypothesis

Pull NFRs that drive tier choice: data size today and projected, RTO, RPO, peak read TPS vs write TPS, regulatory regime (HIPAA, PCI, GDPR, FedRAMP), multi-region needs, and acceptable maintenance windows. Form a tier hypothesis from `references/hyperscale-vs-premium.md`. Use `microsoft_docs_search` to confirm current Hyperscale storage ceiling, replica count, and serverless-on-Hyperscale GA status before locking the choice.

### Step 2: Partition Strategy

Apply `references/partitioning.md`. For time-series, audit tables, multi-tenant ledgers: partition by date (sliding window, switch in / switch out for archival). For hard-tenanted SaaS where one tenant must not block another: partition by tenant id. Never partition on a random hash, GUID, or surrogate key with no business meaning: it produces uniform distribution but kills sliding-window archival, partition elimination on queries, and any future tenant-isolation story.

### Step 3: Query Store and Tuning Loop

Enable Query Store on every production database with the settings in `references/query-store.md`: read-write mode, retention sized for your peak load, and capture mode set to Auto. Establish the weekly cadence: pull top regressions (`sys.query_store_query_text` joined with `sys.query_store_runtime_stats`), force the better plan only after capturing why the regression happened, and log every forced plan in an ADR-style note so the next engineer knows. Plan forcing is a stopgap: pair it with a fix in the next sprint.

### Step 4: Encryption and Searchability

Apply `references/always-encrypted.md`. Classify every column:

- Searchable PII (email, last name, SSN used in equality lookups): deterministic encryption.
- Non-searchable sensitive data (notes, free text, documents): randomized encryption.
- Need range queries, LIKE, or aggregates on encrypted columns: Always Encrypted with secure enclaves (VBS enclave is the default on standard hardware; Intel SGX requires DC-series and Microsoft Azure Attestation). Confirm enclave attestation requirements with `microsoft_docs_search` before promising the capability.

Rotate the column master key (CMK) on a schedule documented in the ADR. Store the CMK in Key Vault, never in app config.

### Step 5: Audit and Ledger

Apply `references/audit-and-ledger.md` for regulated workloads. Audit destinations: Log Analytics for query and detection, Storage for long-term retention, Event Hubs for SIEM streaming. Ledger: choose updatable ledger tables for system-of-record patterns and append-only ledger tables for SIEM-style or attestation patterns. Configure automatic digest storage to immutable Azure Blob Storage or Azure Confidential Ledger; verify digests on a schedule using `sys.sp_verify_database_ledger`.

### Step 6: HA / DR and Failover Groups

Apply `references/failover-groups.md`. For cross-region DR: failover groups with the auto-failover policy disabled until soak testing in a non-prod region pair confirms the listener endpoint behavior under partial-failure modes. Document RTO and RPO targets per environment. For SQL VM workloads needing AGs you control end-to-end, see the IaaS section of `references/failover-groups.md`.

### Step 7: Connection Resilience (client side)

Apply `references/connection-resilience.md`. SqlClient retry logic with exponential backoff plus a circuit breaker (Polly recommended for .NET) is the baseline. EF Core retry-on-failure is covered in `standards/references/coding-stack/ef-core-checklist.md`: do not duplicate that guidance here. The checklist's guidance on `ExecutionStrategy` with explicit transactions is load-bearing: read-modify-write blocks must use `CreateExecutionStrategy().ExecuteAsync(...)` rather than a bare `BeginTransaction`.

### Step 8: Read / Write Splitting

For Hyperscale and Business Critical: use read-only routing via the connection string `ApplicationIntent=ReadOnly`. Do not split reads and writes in app code by holding two connection strings: read-only routing handles it at the gateway. App-side splitting is a fallback only when the tier does not support routing or when you need geo-secondary read for residency reasons.

## Validation

### Tier and capacity checklist
- [ ] Tier choice matches `references/hyperscale-vs-premium.md` decision rules
- [ ] Projected data size at year 2 fits within tier ceiling
- [ ] RTO and RPO targets are achievable on the chosen tier (Hyperscale snapshot restore vs Business Critical AG failover)
- [ ] Read-scale-out replica count sized for peak read TPS (Hyperscale)
- [ ] Maintenance window selected and documented

### Tuning baseline
- [ ] Query Store enabled, read-write, retention sized, capture mode Auto
- [ ] Weekly regression review cadence documented and owned
- [ ] Index review: every FK appearing in WHERE has an index (cross-checked with EF Core checklist)
- [ ] Partitioning matches data lifecycle (date sliding window or tenant)
- [ ] Plan forcing entries logged with rationale and follow-up fix

### Security and compliance
- [ ] Always Encrypted classification per column (deterministic, randomized, enclave)
- [ ] CMK rotation schedule documented; CMK in Key Vault
- [ ] Audit destination configured (Log Analytics + Storage minimum)
- [ ] Ledger enabled for regulated workloads with automatic digest storage to immutable destination
- [ ] Digest verification schedule documented

### HA / DR
- [ ] Failover group configured with the right read-write and read-only listener endpoints
- [ ] Auto-failover policy disabled until soak test passes in non-prod
- [ ] DR runbook references the listener endpoint; app config does not pin a region

### Connection resilience
- [ ] SqlClient retry policy + circuit breaker in app (`references/connection-resilience.md`)
- [ ] EF Core: retry-on-failure enabled where applicable; ExecutionStrategy used for explicit transactions (per `standards/references/coding-stack/ef-core-checklist.md`)
- [ ] Read-only routing used for read replicas (`ApplicationIntent=ReadOnly`)

## Handoff Protocol

```markdown
## Handoff: azure-sql-architect -> [next skill]
### Decisions Made
- Tier: [Hyperscale / Business Critical / General Purpose / MI / SQL VM] with rationale
- Partition strategy: [date sliding window / tenant / none] with column and granularity
- Query Store: enabled, retention X days, regression cadence weekly
- Encryption: Always Encrypted columns classified (deterministic / randomized / enclave); CMK rotation schedule
- Audit + Ledger: [destinations and ledger tables list, digest storage target]
- HA / DR: failover group [name], auto-failover [enabled / disabled until soak], RTO X, RPO Y
- Connection resilience: SqlClient retry + circuit breaker; EF Core retry-on-failure per ef-core-checklist
### Artifacts
- Tier decision ADR | Partition design | Query Store baseline | Encryption classification table | Failover group topology | Connection-resilience pattern reference
### Open Questions
- [items for security-architect, identity-architect, dotnet-architect, finops-architect]
```

## Sibling Skills

- `/data-architect`: Fabric, Databricks, Power BI, Purview, lakehouse, medallion. Hands off here when Azure SQL is the OLTP store under a lakehouse. Do not duplicate that domain.
- `/azure-architect`: Azure platform front-door, networking, Private Endpoint, Managed Identity wiring for SQL.
- `/dotnet-architect`: App-side EF Core patterns, async, DI, primary ctors. Owns `standards/references/coding-stack/ef-core-checklist.md` from the app side.
- `/identity-architect`: Managed Identity to SQL, Entra-only authentication on the logical server, group-based DB roles.
- `/security-architect`: Defender for SQL, Key Vault for CMK, supply-chain controls around T-SQL deployment.
- `/finops-architect`: Hyperscale storage cost crossover with Business Critical, serverless-on-Hyperscale autopause, reserved capacity decisions.
- `/agent`: Pipeline orchestrator. This skill is stack-pinned: it chains after `data-architect` or `azure-architect` when Azure SQL is the data store.

---
> Source: [tqnonline/agent-forge](https://github.com/tqnonline/agent-forge) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-15 -->

