Overview
OpenSRE connects to Azure SQL to diagnose database alerts — checking server health, finding slow queries, monitoring resource usage, and analyzing wait stats to pinpoint bottlenecks. Uses ODBC (ODBC Driver 18 for SQL Server by default).
Prerequisites
- An Azure SQL Database instance
- Network connectivity from your OpenSRE environment to your Azure SQL server (firewall / VNet)
- SQL authentication username and password
- Server hostname (for example
myserver.database.windows.net)
Setup
Option 1: Interactive CLI
Option 2: Environment variables
Option 3: Persistent store
Credentials
Finding your connection details
- Open the Azure Portal
- Navigate to your SQL Database resource
- Copy Server name from the overview panel (add
.database.windows.net if needed)
Network access: Firewall
- In Azure Portal, go to your SQL server → Security → Firewalls and virtual networks
- Add your OpenSRE environment’s IP address
- Or enable Allow Azure services and resources to access this server if running in Azure
If you’re not sure of your IP, start with a permissive rule temporarily, get OpenSRE working, then lock it down.
Verify
Expected output:
Troubleshooting
Security
- Use a dedicated read-only SQL user for OpenSRE — avoid admin credentials.
- Keep encryption enabled (
AZURE_SQL_ENCRYPT=true) in production.
- Restrict firewall rules to the OpenSRE environment’s egress IP.
- Store credentials in
.env or the integration store, never in source code.