canonical: https://jentic.com/apis/azure.com/azure-sql-server-api-spec

# Microsoft Azure Azure SQL Server API spec

Jentic publishes the only available OpenAPI specification for Azure SQL Server API spec, keeping it validated and agent-ready. The API manages the connection policy on an Azure SQL logical server, letting agents read or update whether the server uses Default, Proxy, or Redirect connection routing for clients. It targets the Microsoft.Sql resource provider on Azure Resource Manager and is intended for low-latency or hybrid-network configurations rather than database, login, or firewall management.

## For AI agents

Read or update the connection policy (Default, Proxy, or Redirect routing) on an Azure SQL logical server.

## Scope

Does not handle firewall rules, logins, databases, or backups - use for server-level connection policy only.

## Capabilities

- Retrieve the current connection policy on a SQL server
- Set the connection policy to Default, Proxy, or Redirect
- Switch a server from Proxy to Redirect for lower latency
- Audit connection policy across servers in a subscription
- Bake connection policy into infrastructure-as-code provisioning

## Use cases

### Lower client latency by switching to Redirect

Switch a SQL server from the default Proxy mode to Redirect so clients connect straight to the database node after the initial gateway handshake. The PUT /connectionPolicies/{connectionPolicyName} operation flips the mode in a single call. Useful when application latency budgets cannot absorb the extra hop through the Azure SQL gateway.

Example prompt: PUT /servers/{serverName}/connectionPolicies/Default with connectionType set to Redirect and verify the GET returns the new value

### Force Proxy mode for restricted networks

Set a SQL server to Proxy mode so that all client traffic flows through the Azure SQL gateway, simplifying firewall rules in environments that cannot reach individual node IPs. The same PUT operation accepts Proxy as a value. This is the canonical configuration for clients behind strict outbound firewalls.

Example prompt: PUT /servers/{serverName}/connectionPolicies/Default with connectionType Proxy and confirm subsequent GET returns Proxy

### Connection policy compliance audit

Walk every SQL server in a subscription and report which use Proxy versus Redirect, supporting compliance teams that mandate one mode for security or latency reasons. The GET /connectionPolicies/{connectionPolicyName} operation returns the current setting in a single call per server. Output feeds a Power BI or CSV report.

Example prompt: Iterate every SQL server in subscriptionId X, GET /connectionPolicies/Default, and emit a CSV grouped by connectionType

### Agent-driven server configuration

Let an AI agent flip a SQL server's connection policy in response to a latency alert or network change without an operator hand-writing the ARM URL. Through Jentic the agent searches by intent, loads the policy schema, and executes the PUT. Removes a class of typos on the long Microsoft.Sql resource path.

Example prompt: Search Jentic for 'set azure sql server connection policy', load the connectionType enum schema, and execute against the named server

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName} | Get the server connection policy |
| PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName} | Update the server connection policy |

## Key resources

- **connectionPolicies** — Read or update the server-level connection policy (Default, Proxy, Redirect)

## Why Jentic

- **Setup:** Wiring the Azure SQL Server connection policy API by hand means registering an Azure AD app for OAuth2 bearer auth against management.azure.com and typing out the long Microsoft.Sql server path just to read or set whether clients route through Default, Proxy, or Redirect. Through Jentic you install once, import Azure SQL Server API spec from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** The server sits in the URL path (/servers/{serverName}/connectionPolicies/{connectionPolicyName}), so a rule can pin your agent to one server's connection policy. You choose the operations it may call, so the policy-changing PUT is not included unless you add it, leaving a read-only agent that can only GET the current mode.
- **Credential handling:** Your Azure AD credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'set azure sql server connection policy' or 'check whether a server uses proxy or redirect', and Jentic returns the matching Microsoft.Sql connectionPolicies operation with its connectionType enum schema so the agent calls the right endpoint without memorising the ARM path.

## Related APIs

- **Azure SQL Database** — Manages the databases that sit on the server whose connection policy this API controls
- **Azure SQL Database disaster recovery configurations** — Manages DR pairings on the same SQL server resource
- **Azure SQL Database replication links** — Manages per-database replication on databases hosted by the server

## FAQ

### Why is there no official OpenAPI spec for Azure SQL Server API spec?

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Azure SQL Server API spec via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Azure SQL Server connection policy API use?

The API uses Azure AD OAuth 2.0 with the implicit flow, scoped to user_impersonation against management.azure.com. Through Jentic, the bearer token is held in your Jentic One instance and exchanged for a scoped access token at execution time.

### Can I read the connection policy without changing it?

Yes. GET /servers/{serverName}/connectionPolicies/{connectionPolicyName} returns the current connectionType value (Default, Proxy, or Redirect) without side effects. The connectionPolicyName is always Default at this API version.

### What are the rate limits for this API?

Azure Resource Manager applies tenant-level throttling - typically 12,000 reads and 1,200 writes per hour per subscription. Connection policy writes are quick and synchronous; expect a 200 response rather than 202.

### How do I update the connection policy through Jentic?

Run pip install jentic, then search for 'set azure sql server connection policy'. Jentic returns the PUT /connectionPolicies/Default operation, loads the connectionType enum schema, and executes against the server you specify.

### Does this API manage firewall rules or logins?

No. This API only handles the server-level connection policy. Firewall rules, logins, and database management live under separate Microsoft.Sql resources with their own APIs.

### Can I limit what my agent is allowed to do with the Microsoft Azure SQL Server connection policy API?

Yes. Jentic One is self-hosted by you, so your own rules decide which operations and credentials your agent may use. Because the server sits in the URL path (/servers/{serverName}/connectionPolicies/{connectionPolicyName}), a rule can pin the agent to a single server's connection policy, and you choose which operations it can call. If you grant only the GET, you get a read-only agent that can check whether a server uses Default, Proxy, or Redirect but cannot run the PUT that changes the mode.
