Azure / Azure/data-api-builder
Automatically inject the ApplicationIntent in MSSQL connection strings
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
Azure SQL can take advantage of automatically distributing the **read-only** workload to secondary high-availability replicas, by setting the `ApplicationIntent=ReadOnly` in the connection string: https://learn.microsoft.com/en-us/azure/azure-sql/database/read-scale-out?view=azuresql
It would be great if there could be a setting for MSSQL that tells DAB to automatically inject the `ApplicationIntent=ReadOnly` setting in the connection string whenever a read operation is performed. DAB knows exactly when a read operation is performed, as it happens only in two cases:
- HTTP GET request
- GraphQL Query request
This configuration settiong would go into the database-specific options:
```json
"data-source": {
"database-type": "mssql",
"connection-string": "@env('MSSQL')",
"options": {
"set-session-context": false,
"auto-read-only-intent": true
}
}
```
With this feature DAB would be able to take advantage of read-scale out capabilities of MSSQL, providing even better scalability options.
Contributor guide
Assessment
This issue has not been assessed yet.