Azure SQL Credentials
Managing azure sql credentials means pairing server logins with database users and fixed roles. Teams use these keys so people and AI tools can read or write data. A database user is the identity of a login inside a single database. You must match the right user type to the task at hand. How azure sql credentials work in practice There are thirteen types of database users in the SQL engine. When a person needs to reach many databases, teams create a login in master. That login then maps to a
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.
Managing azure sql credentials means pairing server logins with database users and fixed roles. Teams use these keys so people and AI tools can read or write data.
A database user is the identity of a login inside a single database. You must match the right user type to the task at hand.
How azure sql credentials work in practice
There are thirteen types of database users in the SQL engine. When a person needs to reach many databases, teams create a login in master. That login then maps to a SQL user inside each target database.
Sometimes an app or engineer only needs to reach one or a few databases. In that case, a contained database user with its own password works well. This user type does not tie back to a login in the master database. An admin must first turn on contained databases on the server and the database.
Once the user exists, an admin grants permissions through fixed database roles. Every role, including the public role, holds the right to connect. You cannot change the base rights built into these fixed database roles.
For read access, admins add the user to the datareader role. Members of this role can read all data from all user tables and views. If a person or script must change records, they need the datawriter role. That role lets a user add, delete, or change data in all user tables.
Admins can also block actions with deny roles. A deny datareader role stops a user from reading any user tables or views. It also blocks them from reading metadata about those tables and views. A deny datawriter role stops a user from adding, changing, or deleting any data. At the top level, the owner role can run all setup and upkeep tasks. A user in the owner role can even drop the whole database.
Ephemeral Credentials + Azure RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Security and operational tradeoffs of static keys
Static logins and fixed roles are easy to set up at first. An admin creates a password, assigns a role, and shares the key. Over time, this model creates large risks for engineering teams and AI agents.
First, shared passwords spread across laptops, chat logs, and local config files. When an engineer leaves the team, rotating that shared password can break running apps. Second, fixed roles act as a blunt tool inside an active session. A user in the datareader role can read every row in every user table by default.
That wide view includes sensitive fields like emails, phone numbers, and card numbers. It also includes national IDs stored in customer tables. Native database roles do not rewrite these sensitive fields on the fly. If an AI agent uses a datareader account, it pulls raw customer values. If an engineer has datawriter rights to fix one row, they can delete tables.
Static credentials also leave gaps in audit logs when people share one login. The database log shows the shared SQL user name, not the real person. Teams need a way to tie every query to a single human identity. They also need controls that inspect queries and mask sensitive fields in results. Moving away from shared passwords cuts down the risk of leaked database keys. Adding query checks and data masking keeps live sessions safe for the whole team.
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 SQL login and a contained database user?
A login lives in the master database and works across many databases. A contained user has a password inside one database and needs no master login.
Can I customize the permissions inside a fixed database role?
No, the permissions assigned to fixed database roles cannot be changed. You must combine roles, like datareader and deny datawriter, to shape user rights.
Why is the datareader role risky for AI agents and debugging?
The datareader role grants read access to all user tables and views at once. Without data masking, queries return raw emails, phone numbers, card numbers, and national IDs.
Related guides
In this post