Azure SQL Create Read Only User
To complete an azure sql create read only user setup, add a database user first. Then place that user in the fixed reader role so they can only read data. This setup lets engineers and AI agents inspect tables without changing rows. You can link the user to a server login or make a contained user. How an azure sql create read only user workflow works A database user is the identity a login uses inside a single database. Microsoft supports thirteen different types of database users across its
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
To complete an azure sql create read only user setup, add a database user first. Then place that user in the fixed reader role so they can only read data.
This setup lets engineers and AI agents inspect tables without changing rows. You can link the user to a server login or make a contained user.
How an azure sql create read only user workflow works
A database user is the identity a login uses inside a single database. Microsoft supports thirteen different types of database users across its platform. When a person needs to reach many databases, admins make a login in master. Then they map a database user to that master login inside each target database.
For one or a few databases, a contained database user is another good option. A contained user has its own password and does not need a login in master. Before making one, an admin must turn on contained databases on the server and database.
Once the user exists, you grant read rights through a fixed database role. Every role, including the public role, has basic rights to connect to the database. Adding the user to the reader role lets them read all user tables and views. Admins cannot change the rights built into these fixed database roles.
Sometimes a team needs to block changes or reads even if other roles exist. The deny writer role stops a user from adding, changing, or deleting any table data. The deny reader role blocks a user from reading user tables, views, or their metadata. In contrast, the owner role can run all maintenance tasks and even drop the database.
Security tradeoffs of static roles and active sessions
Fixed reader roles stop accidental writes from engineers, scripts, and AI tools. They make sure a bad query cannot drop a table or wipe out rows. Still, a read-only role is an all-or-nothing pass for data visibility inside that database.
Read-Only Root Filesystem + Azure RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Because the fixed reader role covers all user tables, it exposes sensitive columns too. Anyone with that role can query emails, phone numbers, card numbers, and national IDs. You cannot edit the fixed role itself to hide specific tables or columns.
Static SQL passwords also create operational work for your security team over time. Shared keys end up in local files, chat logs, and agent prompts. When an engineer leaves or a task ends, rotating those shared passwords breaks scripts.
True database safety needs controls that act on the query and the result set. Teams often pair database roles with dynamic data masking that rewrites matched fields in results. They also add query checks and per-user logins so every read leaves a clear log.
Add runtime guardrails beside SQL Server
Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.
With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.
Frequently asked questions
What is the difference between a login and a database user?
A login lives in the master database and lets someone enter the server instance. A database user is the identity inside a specific database mapped to that login. You can also use a contained user, which logs right into one database with a password.
Does the fixed reader role hide sensitive columns by default?
No, members of the fixed reader role can read all user tables and views. You cannot alter the permissions inside a fixed database role to exclude certain columns. To protect emails or card numbers, you need extra masking or custom role setups.
How can I block a user from writing data even if they have other roles?
You can place the user into the fixed deny writer role inside that database. Members of this role cannot add, change, or delete data in any user tables. Likewise, the deny reader role stops all reads of user tables, views, and metadata.
Related guides
In this post