Azure SQL Database Create Read Only User
To run an azure sql database create read only user setup, add a user to the reader role. You first set up a database user and then grant fixed read permissions. This workflow restricts people and AI agents from changing data in your tables. It gives teams safe read access for daily checks and data tasks. How an azure sql database create read only user workflow works A database user is the identity of a login when it connects to a database. Microsoft supports 13 types of database users across
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 run an azure sql database create read only user setup, add a user to the reader role. You first set up a database user and then grant fixed read permissions.
This workflow restricts people and AI agents from changing data in your tables. It gives teams safe read access for daily checks and data tasks.
How an azure sql database create read only user workflow works
A database user is the identity of a login when it connects to a database. Microsoft supports 13 types of database users across its SQL platform. You must choose between two main user models before you grant read access.
For access to many databases on one instance, use a SQL user with a login. That login lives in the master database and links to each user database. For access to one or a few databases, use a contained database user.
A contained user has a password and does not tie to a login in master. An admin must first enable contained databases on the server and the database. Once the user exists, you assign it to a fixed database role.
The standard role for read access is the fixed data reader role. Members of this role can read all data from all user tables and views. All roles, including the public role, also hold basic connect rights.
Admins cannot change the permissions assigned to fixed database roles. To block changes, you can also add the user to the deny data writer role. Members of that deny role cannot add, change, or delete any table data.
When engineers or AI agents log in, the engine checks these fixed role rules. The database lets read queries run and blocks any command that writes data.
Read-Only Root Filesystem + Azure RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Security and operational tradeoffs of static read roles
Fixed read roles stop accidental edits, drops, and data deletes during a session. They work well when a team or app needs broad read rights. Yet static roles and shared passwords leave major security gaps during active sessions.
First, the fixed data reader role grants read rights to every single user table. A user in this role can read sensitive rows right alongside safe rows. If a table holds emails, phone numbers, or card numbers, the role returns them.
Native fixed roles do not rewrite or mask national IDs in query results. If you want to block specific tables, fixed roles alone will not help. The deny data reader role blocks all user tables and views at once.
Second, static SQL passwords stay active until an admin rotates or drops them. If an engineer or AI tool leaks a key, anyone can use it. Static roles also lack built-in approval flows for sensitive read queries.
Third, shared database logins make audit logs hard to read and track. Many team members might share one read user to check production issues. The database log shows the shared SQL user name, not the real person.
To fix this, teams put an access layer in front of the database. That layer links each query to an individual identity and masks sensitive fields. Masking rewrites matched fields like emails and card numbers in query results.
Check SQL Server batches and results on the wire
SQL Server logins and roles decide who connects. They do not check what each TDS batch does or mask sensitive values in returned rows. With hoop.dev, you run an open-source proxy, a sidecar for your SQL Server, inline in the TDS wire protocol. On every batch an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Before a batch hits the server, hoop.dev guardrails refuse disallowed actions with a native TDS error or hold risky statements for approval. On the way back, hoop.dev data masking rewrites sensitive values in supported result columns in memory, and every decision is logged. Explore the MIT-licensed project on GitHub.
Frequently asked questions
What is the difference between a login user and a contained user?
A login user links to a server account stored in the master database. It works best when one person needs access to many databases on an instance. A contained user stays inside one database and uses its own password.
Can I change the permissions inside a fixed database role?
No, you cannot change the permissions assigned to fixed database roles. The data reader role always grants read access to all user tables and views. If you need custom table rules, you must build a custom role instead.
How do I make sure a user can never write or read data?
You can assign the user to a fixed deny role in the database. The deny data writer role blocks adding, changing, or deleting data in user tables. The deny data reader role blocks reading data or metadata from user tables and views.
Related guides
In this post