Azure SQL Authentication Methods

Published
Length
3 min read

Luis Felipe Dias

All posts

The core azure sql authentication methods use either server logins or contained database users. These options verify identity before a person or tool can read or write data. Every database user represents the identity of a login inside a specific database. Microsoft supports 13 types of database users across its SQL engine. Choosing the right setup helps teams control who can run queries in production. It also shapes how developers and AI agents interact with live tables. How azure sql authen

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.

The core azure sql authentication methods use either server logins or contained database users. These options verify identity before a person or tool can read or write data.

Every database user represents the identity of a login inside a specific database. Microsoft supports 13 types of database users across its SQL engine. Choosing the right setup helps teams control who can run queries in production. It also shapes how developers and AI agents interact with live tables.

How azure sql authentication methods work in practice

Engineers and AI agents need clear paths to log in and run queries. A SQL user with a server login is a very common choice. The login lives in the master database and works across the server. Teams use this option when one person needs access to many databases.

Another option is a contained database user with its own password. This user connects straight to one database and skips the master database login. It works well when an app or person needs one or a few databases. Before using this option, an admin must turn on contained databases on the server. The admin must also turn on the setting on the target database itself.

Once a user logs in, fixed database roles control what that user can do. You cannot change the built-in permissions assigned to fixed database roles. All database roles, including the public role, have basic connect rights. Admins add users to fixed roles to grant read or write permissions.

Members of the data reader role can read all data from all user tables. They can also read data from all views in that database. Members of the data writer role can add, delete, or change table data. A deny data reader role stops a user from reading any user tables or views. A deny data writer role blocks a user from adding, changing, or deleting data. At the top level, the database owner role can run all maintenance tasks. That owner role can even drop the entire database.

Azure RBAC + Multi-Factor Authentication (MFA): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Security and operational tradeoffs in active sessions

Static passwords and broad database roles create real risks during an active session. A contained user password shared in a team chat can leak outside the company. If an AI agent uses a data writer role, a bad prompt can delete rows. Even a read-only role lets a user pull every table in the database.

Fixed roles apply to the whole database rather than single columns or rows. A data reader role exposes sensitive fields like emails, phone numbers, and card numbers. Standard role checks stop unauthorized logins at the door. Still, they do not inspect individual queries once the session starts.

Teams often struggle to track who ran a specific query when apps share logins. Rotating static passwords across many scripts and services also takes hours of manual work. To reduce risk, teams need controls that work at the query and field level. Dynamic data masking can rewrite matched fields like national IDs in query results. Pairing identity checks with query-level controls keeps production data safe during live work.

Govern SQL Server queries and responses in flight

Table grants decide which SQL Server objects a caller may touch. They do not check query intent or rewrite sensitive values in results across every client and agent. By design, hoop.dev sits inline in the TDS wire protocol next to SQL Server as a sidecar for your SQL Server. On every production batch from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for approval.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused or held for review, matched sensitive fields in supported result columns are masked in memory, and each decision is logged. Check out the code on GitHub.

Frequently asked questions

When should a team use a login in master versus a contained user?

Use a login in the master database when people need access to many databases. Use a contained database user when someone needs access to one or a few databases.

Can an admin change the permissions of fixed database roles?

No, you cannot change the permissions assigned to fixed database roles in SQL. Instead, you can combine allow and deny roles or create custom roles for specific needs.

What is the risk of granting the data reader role to an AI agent?

The data reader role lets the agent read all data from all user tables. Without field masking, query results will include raw emails, phone numbers, and card numbers.

The query runs. The emails stay hidden.