/microsoft-sql-admin:ha-assessment-health-check [AGName]from Microsoft SQL administration
Proactively validates SQL Server Always On availability group health including sync, listeners, and failover readiness before audits, go-lives, or changes. Read-only assessment only.
Ships in Microsoft SQL administration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Proactive assessment only. Do not change configuration unless the user explicitly asks. For active issues, use investigate-ha-issues instead.
geo-dr-assessment-health-check skill.microsoft-sql-admin plugin (mssql_list_database_connections,
mssql_connect_database, then mssql_execute_query); any other SQL tool the agent host provides for
running T-SQL and reading result sets;
sqlcmd from a terminal. If the SQL
Tools MCP server is not connected or lists no connections, follow the sql-tools-mcp-setup skill,
which asks before installing or configuring anything. If no SQL tool can be made available, give the
user the T-SQL to run and ask for the results.VIEW SERVER PERFORMANCE STATE (VIEW SERVER STATE before SQL Server 2022) or, on Azure
SQL Database, VIEW DATABASE PERFORMANCE STATE or ##MS_ServerStateReader##, plus any other read
permission these queries need. A tool is only as read-only as the login it connects with.SELECT @@SERVERNAME, DB_NAME(), SUSER_SNAME(), SERVERPROPERTY('EngineEdition')).| Parameter | Default | Description |
|---|---|---|
| AGName | (all AGs) | Filter to a specific AG. Omit to assess all. |
ALTER AVAILABILITY GROUP including FAILOVER and
FORCE_FAILOVER_ALLOW_DATA_LOSS, ALTER DATABASE, sp_configure with RECONFIGURE, and
CREATE LOGIN) are recommendations only.FORCE_FAILOVER_ALLOW_DATA_LOSS can lose committed transactions.Execute steps in order. Step 1 determines which steps apply per platform.
Note on step numbering: There is intentionally no Step 7 — the workflow runs 1–6 then 8–13. The numbers are stable identifiers referenced by the routing matrix, report template, and remediation guide, so the gap is preserved deliberately rather than renumbered.
Run with the SQL query tool.
Query: See references/queries.md#step-1-platform-detection-and-ha-capability
Platform routing — use this matrix for all subsequent steps:
| Engine Edition | Steps to Execute | Query Reference |
|---|---|---|
| 3 (Enterprise) | Steps 1–6, 8, 9, 11, 12, 13 — requires IsHadrEnabled = 1 for steps 2–6, 8, 9, 12–13 | Step 1: queries.md, Steps 2–6, 8, 9, 12–13: queries-sqlserver.md, Step 11: queries-azure.md |
| 2 (Standard) | 1, 2, 3, 4, 5, 6, 8, 9, 11, 12 — requires IsHadrEnabled = 1 for AG steps | Step 1: queries.md, Steps 2–6, 8, 9, 12: queries-sqlserver.md, Step 11: queries-azure.md |
| 5 (Azure SQL DB) | 1, 10, 11 only | Step 1: queries.md, Steps 10–11: queries-azure.md |
| 8 (Azure SQL MI) | 1, 10, 11, 12 always. Run AG steps 3, 4, 5, 8 only when an MI-link AG exists (ag_count > 0) — a standalone MI's HA is platform-managed and is not exposed via the AG catalog views/DMVs, so empty AG/listener results are expected and must not be reported as FAIL; assess MI HA via Step 10 instead (no cluster/endpoint/backup — msdb.dbo.backupset does not record managed backups) | Step 1: queries.md, AG steps: queries-sqlserver.md, Steps 10–11: queries-azure.md |
| 12 (Fabric SQL DB) | 1, 10, 11 only | Step 1: queries.md, Steps 10–11: queries-azure.md |
| 9 (Azure SQL Edge) | 1, 11 only (no AG/cluster — Always On is not supported on SQL Edge) | Step 1: queries.md, Step 11: queries-azure.md |
| 6 (Synapse Dedicated), 11 (Synapse serverless / Fabric Warehouse) | Stop — HA assessment not applicable. Report N/A. | — |
| 1, 4 (Personal/Express) | Stop — HA not supported. Report FAIL. | — |
AG steps (2–9, 12–13) require
IsHadrEnabled = 1. If HADR is not enabled on Enterprise/Standard, skip AG steps and report as finding.
Run the HA Posture Classification query (second query in references/queries.md#step-1-platform-detection-and-ha-capability) and branch on the ha_posture column. The classification uses DMVs only.
is_hadr_enabled = 0, or HADR enabled with ag_count = 0): Stop the AG steps (2–9, 12–13). The instance is a single point of failure. Report this as the primary finding and deliver the enablement guidance in references/remediation-guide.md#branch-a--no-ha-enabled.basic_ag_count > 0, Standard Edition): Run the applicable AG steps, then evaluate the Basic AG limitations and best practices in references/remediation-guide.md#branch-b--basic-availability-group.advanced_ag_count > 0): Run the full AG steps, then apply the best-practice review in references/remediation-guide.md#branch-c--advanced-full-availability-group.Azure platforms (Engine Edition 5, 8, 12) have platform-managed HA that cannot be disabled. Skip this decision tree and use Steps 10–11.
Load and execute queries from references/queries-sqlserver.md for each applicable step per the routing matrix above. Execute the SQL exactly as written — do not invent replacement queries.
Each query includes guard conditions and inline PASS/FAIL/WARNING verdicts via SQL CASE columns.
For each step with FAIL or WARNING verdicts: read the corresponding section in references/remediation-guide.md for remediation guidance:
Load and execute queries from references/queries-azure.md. Run the service tier query for all Azure platforms. Then run the geo-replication query (DB only) or failover group query (MI only) as applicable.
If FAIL/WARNING: read references/remediation-guide.md.
Load and execute the connection resiliency query from references/queries-azure.md. Applies to all platforms.
If FAIL/WARNING: read references/remediation-guide.md.
For SQL Server (and MI only when an MI-link AG exists): load and execute the scorecard query from references/queries-sqlserver.md. For Azure SQL DB, Fabric, and standalone MI (platform-managed HA): produce scorecard from Step 10 results only (no scorecard query).
Enterprise only (Engine Edition 3), SQL Server 2016+ (v13+). Requires
IsHadrEnabled = 1. Skip if no distributed or contained AGs are detected.
Load and execute the distributed/contained AG query from references/queries-sqlserver.md.
This step detects:
last_hardened_lsn vs last_commit_lsn), and flags availability mode mismatches between underlying AGs.If FAIL/WARNING: read references/remediation-guide.md.
Read references/report-template.md before presenting the final assessment report.
Apply final status:
sys.dm_hadr_* and sys.availability_* DMVs do not exist on Azure SQL DB (5), Fabric SQL DW (11), or Fabric SQL DB (12). Never run AG queries on those platforms.IsHadrEnabled = 1 first.sys.dm_geo_replication_link_status — NOT sys.dm_hadr_fabric_replica_states.sys.availability_group_listeners — unless an MI link is configured. Never report empty listeners as FAIL on MI; assess MI HA via Step 10 (sys.dm_geo_replication_link_status).msdb.dbo.backupset history may be truncated or empty on secondaries — backup assessment is most reliable on the primary.automated_backup_preference (SECONDARY/SECONDARY_ONLY). In that case the primary's msdb.dbo.backupset will not contain those records — Step 9 downgrades a missing full backup to WARNING (not FAIL) when the preference targets a secondary. Verify backups on the preferred backup replica.is_distributed = 1) only support manual failover. Do not report missing automatic failover as an issue for distributed AGs.is_contained = 1, SQL 2022+) replicate master/msdb within the AG. The is_contained column does not exist on SQL Server versions prior to 2022 — guard with version check.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-sql-admin47 skills in this plugin
/active-connectionsUse when the user asks who is connected, which sessions are idle or hold the oldest open transaction, or how connections split by login or app. If a client can't connect, use `connectivity-troubleshoot`./always-encrypted-columnsUse when the user asks which plaintext columns can or should use Always Encrypted, or why a column is disqualified. Eligibility only: not for listing already-encrypted columns or their keys./authentication-diagnosticsUse when a login fails (18456, 'Login failed for user'), a user can't open a database, a permission is denied, or an Entra or managed identity login fails. For network errors, use `connectivity-troubleshoot`./backup-history-azuresqlUse when the user asks for backup history, the latest backups or backup retention on Azure SQL Database or Fabric SQL Database. For SQL Server or Managed Instance, use `backup-strategy-sqlserver`./backup-strategy-sqlserverUse when the user asks to review or design a SQL Server or Managed Instance backup strategy, or whether the recovery model and backup schedule meet an RPO. For Azure SQL Database, use `backup-history-azuresql`./blocking-root-cause-analysisUse when the user asks what caused blocking that already ended (yesterday's incident, intermittent lock waits) or who is behind a supplied blocking chain. For blocking happening now, use `check-live-blocking`.Other plugins' skills for the same job