Azure SQL Query
LAST UPDATED: MAY 23, 2025
Overview
Azure SQL Database is a fully managed cloud-based relational database service built on Microsoft SQL Server technology hosted on Azure Cloud service. This integration enables organizations to query table content of the given Azure SQL server.
D3 SOAR is providing REST operations to function with Azure SQL Query.
Azure SQL Query is available for use in:
Connection
To connect to Azure SQL Query from D3 SOAR, follow this part to collect the required information below:
Parameter | Description | Example |
Server URL | The URL of the Azure SQL Server instance. Ensure that the D3 vSOC public IP addresses are explicitly allowed under Security > Networking > Firewall rules to permit access through the server's firewall. | <your-server-name>.database.windows.net |
Database | The SQL database name. | sqldb1 |
Username | The username used to connect to the SQL server. | User1 |
Password | The password used to connect to the SQL server. | ***** |
Configuring Azure SQL Query to Work with D3 SOAR
READER NOTE
D3 vSOC’s public IP addresses are required to configure Azure SQL Query for use with D3 SOAR. If unknown, contact D3 to obtain them.
Log into the Azure portal.
Enter SQL servers in the search bar, then select the matching result.
Select the desired server.
Open the Security accordion, then select the Networking tab.
Allow the D3 vSOC public IP address to access the SQL Server by creating a new firewall rule.
Click the + Add a firewall rule button.
Provide a descriptive name for the rule
Enter the IP address(es) obtained from D3.
Click the OK button to save the rule.
Configuring D3 SOAR to Work with Azure SQL Query
Log in to D3 SOAR.
Find the Azure SQL Query integration.
Navigate to Configuration on the top header menu.
Click on the Integration icon on the left sidebar.
Type Azure SQL Query in the search box to find the integration, then click it to select it.
Click on the + Connection button on the right side of the Connections section. A new connection window will appear.
Configure the following fields to create a connection to Azure SQL Query.
Connection Name: The desired name for the connection.
Site: Specifies the site to use the integration connection. Use the drop-down menu to select the site. The Share to Internal Sites option enables all sites defined as internal sites to use the connection. Selecting a specific site will only enable that site to use the connection.
Recipient site for events from connections Shared to Internal Sites: This field is displayed when Share to Internal Sites is selected for the Site field, allowing selection of the internal site for deploying the integration connection.
Agent Name (Optional): Specifies the proxy agent required to build the connection. Use the dropdown menu to select the proxy agent from a list of previously configured proxy agents.
Description (Optional): Add a description for the connection.
Tenant (Optional): When configuring the connection from a master tenant site, users have the option to choose the specific tenant sites to share the connection with. Once this setting is enabled, users can filter and select the desired tenant sites from the dropdowns to share the connection.
Active: Check the checkbox to ensure the connection is available for use.
Configure User Permissions: Defines which users have access to the connection.
System: This section contains the parameters defined specifically for the integration. These parameters must be configured to create the integration connection.
1. Input the Server URL in the following format: <your-server-name>.database.windows.net.
2. Input the Database name.3. Input the Username.
4. Input the Password.
Enable Password Vault: An optional feature that allows users to take the stored credentials from their own password vault. Refer to the password vault connection guide if needed.
Connection Health Check: Periodically checks the connection status by scheduling the Test Connection command at the specified interval (in minutes). Available only for active connections, this feature also allows configuring email notifications for failed attempts.
Test the connection.
Click on the Test Connection button to verify credentials and connectivity. A success alert displays Passed with a green checkmark. If the connection fails, review the parameters and retry.
Click OK to close the alert window.
Click + Add to create and add the configured connection.
Commands
Azure SQL Query includes the following executable commands for users to set up schedules or create playbook workflows. With the Test Command function, users can execute these commands independently for playbook troubleshooting.
List Tables
Retrieve all tables in the database.
Input
N/A
Output
To view the sample output data for all commands, refer to this article.
Error Handling
If the Return Data displays Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | List Tables failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Azure SQL Query portal. Refer to the HTTP Status Code Registry for details. | Status Code: 403. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: [42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server '*****' requested by the login. Client with IP address '***.***.***.***' is not allowed to access the server. To enable access, use the Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. (40615) (SQLDriverConnect) |
Error Sample Data List Tables failed. Status Code: 403. Message: [42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server '*****' requested by the login. Client with IP address '***.***.***.***' is not allowed to access the server. To enable access, use the Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. (40615) (SQLDriverConnect) |
SQL Query
Executes an SQL query. A list of all tables in the database can be obtained using the List Tables command.
Input
Input Parameter | Required/Optional | Description | Example |
SQL Query Statement | Required | The full SQL query to execute against the database. | SELECT TOP 10 * FROM Asset_Severity WHERE SeverityName = 'Low' |
Output
To view the sample output data for all commands, refer to this article.
Error Handling
If the Return Data displays Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | SQL Query failed. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Azure SQL Query portal. Refer to the HTTP Status Code Registry for details. | Status Code: 404. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: [42S02] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Invalid object name '*****'. (208) (SQLExecDirectW) |
Error Sample Data SQL Query failed. Status Code: 404. Message: [42S02] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Invalid object name '*****'. (208) (SQLExecDirectW) |
Test Connection
Allows users to perform a health check on an integration connection. Users can schedule a periodic health check by selecting Connection Health Check when editing an integration connection.
Input
N/A
Output
Output Type | Description | Return Data Type |
Return Data | Indicates one of the possible command execution states: Successful or Failed. The Failed state can be triggered by any of the following errors:
More details about an error can be viewed in the Error tab. | String |
Error Handling
If the Return Data displays Failed, an Error tab will appear in the Test Result window.
The error tab contains the details responded from D3 SOAR or third-party API calls, including Failure Indicator, Status Code, and Message. This can help locate the root cause of a command failure.
Parts in Error | Description | Example |
Failure Indicator | Indicates the command failure that happened at a specific input and/or API call. | Test Connection failed. Failed to check the connector. |
Status Code | The response code issued by the third-party API server or the D3 SOAR system that can be used to locate the corresponding error category. For example, if the returned status code is 401, the selected connection is unauthorized to run the command. The user or system support would need to check the permission setting in the Azure SQL Query portal. Refer to the HTTP Status Code Registry for details. | Status Code: 403. |
Message | The raw data or captured key error message from the integration API server about the API request failure. | Message: [42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server '*****' requested by the login. Client with IP address '***.***.***.***' is not allowed to access the server. To enable access, use the Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. (40615) (SQLDriverConnect) |
Error Sample Data Test Connection failed. Failed to check the connector. Status Code: 403. Message: [42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server '*****' requested by the login. Client with IP address '***.***.***.***' is not allowed to access the server. To enable access, use the Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. (40615) (SQLDriverConnect) |