Azure SQL Firewall Logs

Published
Length
3 min read

Luis Felipe Dias

All posts

You use azure sql firewall logs to track which network addresses reach your database. These records show allowed and blocked connections at the server boundary before login starts. Teams rely on these records to check IP rules and spot unwanted traffic. Yet network records only show the outer gate and miss what happens inside a session. How azure sql firewall logs work for engineers and AI agents When an engineer or AI agent connects, the cloud firewall checks the source IP first. If the rul

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 use azure sql firewall logs to track which network addresses reach your database. These records show allowed and blocked connections at the server boundary before login starts.

Teams rely on these records to check IP rules and spot unwanted traffic. Yet network records only show the outer gate and miss what happens inside a session.

How azure sql firewall logs work for engineers and AI agents

When an engineer or AI agent connects, the cloud firewall checks the source IP first. If the rule blocks the address, the server drops the request right away.

The system then writes an entry into the azure sql firewall logs for review. If the IP passes the rule, the request moves to the database login step.

Here, the server checks the login in the master database or a contained user. A database user is the identity of a login when it connects to a database.

For access to many databases on an instance, a login in master is common. For one or a few databases, admins can enable contained database users with a password.

There are thirteen types of database users available in the platform. Once the user logs in, the firewall has finished its job for that session.

AI agents and scripts often run from cloud workers with shifting IP addresses. When a worker changes its IP, the firewall blocks it and writes a log entry.

Engineers then read these records to find out why an automated task failed. This helps teams fix broken network rules without guessing which IP caused the drop.

Security and operational tradeoffs of network logs and static roles

Network rules and azure sql firewall logs only guard the front door of your server. Once an IP passes the check, the firewall does not inspect the SQL queries.

At that point, security depends on the database roles assigned to the user. Every role, including the public role, has basic permission to connect to the database.

Azure RBAC + Firewall Configuration: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Admins often put users into fixed database roles to control what they can do. You cannot change the permissions that belong to these fixed database roles.

For example, a read-only role lets a user read all data from all user tables. It also lets the user read all views across that database.

A write role lets a user add, delete, or change data in user tables. An owner role can run all maintenance tasks and even drop the database.

Admins can also use deny roles to block reading or writing across user tables. Even with a read role, a user or agent can pull sensitive rows.

Firewall records will show a valid IP, while the query reads emails or phone numbers. Static keys and wide roles leave card numbers and national IDs exposed during active sessions.

Why query-level controls matter beyond the firewall

Managing IP lists for remote staff and cloud agents takes a lot of daily work. Teams often open wide IP ranges so dynamic workers can reach the database.

When you open wide network ranges, your firewall records lose much of their value. You see traffic from an allowed cloud range, but you do not know who sent it.

Shared database logins make this problem worse for security and audit teams. Five engineers might share one login and come from the same office IP address.

The network log shows one IP, and the database shows one shared user name. You cannot tell which person ran a slow or risky query during that hour.

To fix this, teams need controls that tie every query to a real person. They also need data masking that rewrites matched fields like emails in query 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

Do azure sql firewall logs show the SQL queries a user ran?

No, firewall logs only record network connection attempts and source IP addresses. They do not capture SQL text, table names, or the data returned in a session.

What happens after a connection passes the Azure SQL firewall?

The server checks the login in master or verifies a contained database user password. After login, fixed database roles control whether the user can read or change table data.

Can fixed database roles hide sensitive columns like phone numbers or card numbers?

No, the standard read role grants read access to all user tables and views. You need extra controls like data masking to rewrite matched fields in query results.

The query runs. The emails stay hidden.