Azure SQL Authentication Types
The main azure sql authentication types rely on server logins and database users. You can use a SQL user tied to a master login or a contained user. Choosing the right identity model is the first step in database security. Engineers and AI agents need clear rules before they connect to any data store. Understanding how logins map to database users helps teams avoid wide access gaps. How azure sql authentication types work in practice A database user is the identity of a login inside a databa
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 main azure sql authentication types rely on server logins and database users. You can use a SQL user tied to a master login or a contained user.
Choosing the right identity model is the first step in database security. Engineers and AI agents need clear rules before they connect to any data store. Understanding how logins map to database users helps teams avoid wide access gaps.
How azure sql authentication types work in practice
A database user is the identity of a login inside a database. In total, the database engine supports 13 types of database users. When a person or app logs in, the engine checks the server login first. Then it maps that login to a user record inside the target database.
For people who use many databases on one instance, a master login works well. You create a SQL user with a login in the master database. That single login can then link to user accounts across several databases. This keeps account setup in one place for server admins.
For access to one or a few databases, a contained user is an option. A contained database user is a SQL user with a password. It does not tie to a login in the master database. Instead, the database itself holds the user credentials and checks them at login time. Before you use this method, an admin must turn on contained databases. They must enable this setting on both the server and the database.
Roles and limits of static database access
Once a user logs in, fixed database roles control what they can do. Every role, including the public role, has the right to connect. You cannot change the permissions assigned to fixed database roles. Admins add users to these roles to grant broad read or write rights.
Members of the data reader role can read all user tables and views. If you want to block reads, you can use the deny data reader role. Members of that role cannot read any data from user tables or views. They also cannot read metadata about those tables or views.
Azure RBAC + Multi-Factor Authentication (MFA): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
For write access, the data writer role allows users to add, delete, or change data. It applies to all user tables in the database. The deny data writer role stops a user from adding, changing, or deleting data. At the top level, the database owner role has full control. Members can run all setup and maintenance tasks and can even drop the database.
These built-in roles and user types solve the basic login problem. Yet they leave major gaps during an active session. A SQL user with a password relies on a static secret. People can share that password, store it in plain text, or leak it in logs. Even with a read-only role, a user can still read every table. If a table holds sensitive fields, a basic role will not hide them. Data masking is needed to rewrite matched fields like emails, phone numbers, or card numbers. Also, static roles do not require peer approval before a risky query runs.
Managing live sessions for engineers and AI agents
Modern teams have both human engineers and AI agents running queries. Giving each person or bot a permanent SQL password creates heavy toil. Admins must rotate keys and track user accounts across many databases.
A better pattern separates identity checks from raw database secrets. Teams can route traffic through a central proxy layer. The proxy checks the user identity from your single sign-on provider. It then uses a single managed credential to reach the database. This approach lets you inspect queries one by one and mask national IDs in results.
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
What is the difference between a login and a database user?
A login is a server-level account stored in the master database. A database user is the identity of that login inside a specific database.
When should I use a contained database user?
Use a contained user when someone only needs one or a few databases. It uses a password inside the database and skips the master login.
Can I customize the permissions of fixed database roles?
No, you cannot change the permissions assigned to fixed database roles. To restrict a data reader on one table, combine roles or use custom permissions.
Related guides
In this post