How to Configure Azure SQL Password Policy
You set up an azure sql password policy by defining rules on logins or users. Admins apply these rules when creating SQL logins or contained database users. Most teams start by setting up logins in the master database for their staff. They then map those logins to database users inside each target database. Problems happen when teams share one login or assign broad database roles to everyone. How an azure sql password policy works with logins and users A database user is the identity of a log
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.
You set up an azure sql password policy by defining rules on logins or users. Admins apply these rules when creating SQL logins or contained database users. Most teams start by setting up logins in the master database for their staff. They then map those logins to database users inside each target database. Problems happen when teams share one login or assign broad database roles to everyone.
How an azure sql password policy works with logins and users
A database user is the identity of a login inside a single database. SQL engines offer thirteen types of database users for different access needs. When a person needs to reach many databases, admins create a login in master. That login links to a SQL user inside each database on the server. Password rules apply to the login in the master database.
For access to one or a few databases, a contained user works well. A contained database user is a SQL user with its own password. It does not tie back to a login in the master database. An admin must first turn on contained databases on the server and database. Teams must track password rules across both master logins and contained database users.
How database roles pair with your password rules
A strong password rule only checks who can log in to the server. Once inside, fixed database roles decide what that user can read or write. All roles, including the public role, have permission to connect to the database. You cannot change the permissions built into fixed database roles.
Members of the data reader role can read all data from user tables. They can also read data from all views in that database. The deny data reader role blocks a user from reading tables, views, or metadata. Members of the data writer role can add, change, or delete table data. The deny data writer role stops a user from adding, changing, or deleting data. The owner role can run all setup tasks and even drop the database.
Application-to-Application Password Management + Azure Policy: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Where native password rules and roles fall short
Password rules and fixed roles only check identity at the start of a session. They do not check what individual queries do while the session is active. A user with the data reader role can read every table and column. That includes columns with emails, phone numbers, card numbers, and national IDs.
Shared SQL passwords also make it hard to see who ran a bad query. When five engineers share one login, the logs show only that single login name. Rotating that shared password breaks local scripts and forces every engineer to update settings. Teams need a way to link every query to a real person. They also need a way to mask sensitive fields in query 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 SQL login and a contained user?
A login lives in the master database and works across many databases on an instance. A contained user has its own password inside one database and needs no master login.
Can I edit the permissions of fixed database roles after login?
No, the database engine locks the permissions assigned to fixed database roles. If you need custom rules, you must build a user-defined role instead.
Does a password policy hide sensitive columns from data readers?
No, password rules only control who can log in to the database. A member of the data reader role can still read all user tables and views.
Related guides
In this post