Skip to main content

Connecting Azure SQL

Connect an Azure SQL Database to FreshGuard for monitoring.

Azure SQL requires a Starter plan or higher. Starter+

Authentication Methods

FreshGuard supports two authentication methods for Azure SQL. Choose based on how your Azure SQL server is configured.

SQL Authentication (default)

Use this when SQL logins are enabled on the server.

FieldDescriptionExample
ServerAzure SQL server namemyserver.database.windows.net
PortPort (default 1433)1433
DatabaseDatabase nameanalytics
UsernameSQL login namefreshguard_reader
PasswordLogin password
EncryptRequire encrypted connectiontrue

Entra Service Principal

Use this when your Azure SQL server is in Entra-only mode (SQL authentication disabled). You will need an Entra app registration — see the Azure SQL: Read-Only Login guide for setup instructions.

FieldDescriptionExample
ServerAzure SQL server namemyserver.database.windows.net
PortPort (default 1433)1433
DatabaseDatabase nameanalytics
Auth typeAuthentication methodEntra Service Principal
Tenant IDDirectory (tenant) IDxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Client IDApplication (client) IDxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Client SecretSecret value
EncryptRequire encrypted connectiontrue

Setup Steps

  1. In the FreshGuard dashboard, go to Sources and click Add Source.
  2. Select Azure SQL.
  3. Enter your server name (including .database.windows.net) and database name.
  4. Select your authentication method and fill in the corresponding credentials.
  5. Leave Encrypt enabled — Azure SQL requires encrypted connections.
  6. Click Test Connection to verify access.
  7. Save.

Info

Azure SQL always requires encrypted connections. The Encrypt setting defaults to true and should not be disabled.

Firewall Configuration

Azure SQL uses a server-level firewall. You must allow FreshGuard’s outgoing IP addresses:

  1. In your FreshGuard dashboard, go to Settings → Network to find FreshGuard’s current outgoing IPs.
  2. In the Azure Portal, navigate to your SQL server.
  3. Go to Networking (under Security).
  4. Under Firewall rules, add a rule for each IP address.

Common Issues

Connection Refused

  • Verify the firewall rules include FreshGuard’s IP addresses.
  • Confirm the server name is correct (it must end with .database.windows.net).
  • Check that the database is online and not paused (serverless tier may auto-pause).

Authentication Failed

SQL authentication: Ensure the login exists on the server (master database) and a corresponding user has been created in the target database with db_datareader access.

Entra Service Principal: Ensure a contained database user was created with CREATE USER [...] FROM EXTERNAL PROVIDER in the target database. Verify the Tenant ID, Client ID, and Client Secret are correct, and that the client secret has not expired.

Database Paused (Serverless)

If your Azure SQL database uses the serverless compute tier, it may auto-pause after inactivity. FreshGuard will trigger an automatic resume, but the first connection may be slower.

Create a dedicated read-only login for FreshGuard. See the Azure SQL: Read-Only Login guide for the exact T-SQL commands.