Azure SQL List Users
To run an azure sql list users check, you query the system catalog views inside your target database. This check returns every active database user identity and its mapped role. Teams review these accounts to see who can read or change production data. A clear user list is the first step in database security. Yet static user lists only show who can log in, not what happens next. How an azure sql list users check works in practice A database user is the identity of a login when it connects. M
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 list users check, you query the system catalog views inside your target database. This check returns every active database user identity and its mapped role.
Teams review these accounts to see who can read or change production data. A clear user list is the first step in database security. Yet static user lists only show who can log in, not what happens next.
How an azure sql list users check works in practice
A database user is the identity of a login when it connects. Microsoft SQL systems support 13 types of database users across different setups. When you list users, you see two main account patterns.
The first pattern is a standard SQL user tied to a login. The login lives in the master database on that server instance. This setup is common when people need access to many databases.
The second pattern is a contained database user with its own password. This account is not tied to any login in the master database. It works well when someone needs access to one or a few databases. An admin must enable contained databases on the server and database first.
Engineers and AI agents both rely on these user accounts to run queries. When you audit accounts, you also check which fixed roles each user holds. Every role, including the public role, has basic permission to connect.
Admins assign users to fixed roles to control read and write power. A read role lets a user read all data from all user tables. That same read role also covers all user views in the database. A write role lets a user add, delete, or change table data.
Azure RBAC + SQL Query Filtering: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Security tradeoffs of static users and fixed database roles
Listing database users and roles shows you the static state of access. You can see who holds the owner role, which allows all maintenance work. An owner account can even drop the entire database in SQL Server. You can also see who holds deny roles that block reads or writes.
Still, fixed database roles have a major limit for modern security teams. The permissions assigned to fixed database roles cannot be changed at all. A read role grants read power over every single table and view.
Once a user or AI agent logs in, that role stays active. Static user lists do not tell you which queries a person ran. They also cannot stop a read user from pulling sensitive customer columns.
If an engineer runs a broad select query, raw sensitive data returns. Static database roles do not mask emails, phone numbers, or card numbers. They also do not require peer approval before a risky command runs.
Managing dozens of individual logins across many databases also creates manual toil. Teams spend hours adding and removing accounts as people change roles. When an account keeps the session active too long, shared passwords create audit gaps. To fix this, teams put a control layer in front of the database. This layer checks user identity, logs every query, and masks sensitive 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 SQL login and a database user?
A login lives in the master database and handles server sign-in. A database user is the identity of that login inside one specific database. Contained database users skip the master login and sign in at the database.
Can I customize the permissions of a fixed database role?
No, the permissions assigned to fixed database roles cannot be changed. For example, the standard read role always grants read access to all user tables. To limit access further, you need custom roles or query-level controls.
How do deny roles affect an azure sql list users audit?
Deny roles block specific actions even if a user holds other roles. A deny read role stops a user from reading any user tables or views. A deny write role stops a user from adding, changing, or deleting data.
Related guides
In this post