An Azure relational database service.
The place to go with feature requests like this one is https://feedback.azure.com/d365community/post/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Please add a setting for Azure SQL database contained users that controls which replica types they can connect to:
Read-only: Allow connections only to read-only replicas.
Read-write: Allow connections only to the read-write primary.
Both: Allow connections to either replica type. This would be the default to preserve existing behavior.
Azure SQL should enforce this restriction when establishing a connection, based on the replica’s current role, including after failover.
This would let us restrict reporting users to read-only replicas and prevent them from connecting to the production primary, helping protect transactional workload performance.
An Azure relational database service.
The place to go with feature requests like this one is https://feedback.azure.com/d365community/post/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0
AI answer
Azure SQL Database does not currently document a per-contained-user setting that restricts connections to read-only replicas, the read-write primary, or both; submit this as an Azure SQL feature request, and use Hyperscale named-replica access isolation when that service-tier-specific design is applicable.
Post the proposal through the Azure SQL Database feedback channel linked from the release documentation ^1^.
Include these requirements explicitly:
ReadOnly, ReadWrite, and Both values.Both as the compatibility-preserving default.For standard Azure SQL read scale-out, the client chooses its routing intent:
ApplicationIntent=ReadOnly routes the connection to a read-only replica.ApplicationIntent=ReadWrite, or omitting the setting, routes it to the read-write replica.DATABASEPROPERTYEX ^2^.Server=tcp:<server>.database.windows.net;
Database=<database>;
ApplicationIntent=ReadOnly;
User ID=<user>;
Password=<password>;
Encrypt=True;
SELECT DATABASEPROPERTYEX(DB_NAME(), 'Updateability');
The query returns READ_ONLY on a read-only replica. This can validate routing, but it does not prevent that same user from supplying ApplicationIntent=ReadWrite in another connection.
For failover groups, read-only workloads can use the read-only listener:
Server=<failover-group>.secondary.database.windows.net;
Database=<database>;
ApplicationIntent=ReadOnly;
That listener automatically targets the geo-secondary ^3^. It is still an endpoint and connection-routing mechanism, not a contained-user restriction.
If the database uses Azure SQL Database Hyperscale named replicas, Microsoft documents a design that grants a principal access to a named replica without granting access to the primary or other named replicas ^4^.
The documented design is:
The resulting principal can authenticate to the named replica but not the primary. This provides both access and compute isolation, but it is not the proposed role-aware property:
Do not treat ApplicationIntent=ReadOnly alone as a security boundary. In Hyperscale, if no secondary replica exists, a read-intent connection can be routed to the primary and default to read-write behavior ^5^.
References