What network config to hit azure sql in azure batch job

Tomahawk2 0 Reputation points
2024-04-04T20:30:20.3266667+00:00

Running into issues where azure batch job can't hit sql server. Both are in the same subnet. What network configuration is required to allow the azure batch pool and sql azure database to communicate? I would assume the azure batch job that is just hitting the azure sql wouldn't be that complicated and would be allowed.

Azure SQL Database
Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
302 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 22,056 Reputation points
    2024-04-10T08:02:46.9333333+00:00

    Hello @Tomahawk2

    Thank you for reaching out to the Microsoft Q&A platform.

    If your Azure Batch pool and SQL Server database are in the same subnet, they should be able to communicate with each other by default. However, there are a few things you can check to make sure that the network configuration is set up correctly.

    First, make sure that the SQL Server is configured to allow connections from the Azure Batch pool. You can do this by checking the firewall settings on the SQL Server. By default, SQL Server is configured to block all incoming connections except for those on the same machine.
    You will need to add an exception to the firewall to allow connections from the Azure Batch pool. You can do this by adding an inbound rule to the firewall that allows traffic on port 1433 (the default port for SQL Server). Next, make sure that the Azure Batch pool is configured to use the correct network settings.
    When you create a Batch pool, you can specify the virtual network and subnet that the pool should use. Make sure that the pool is configured to use the same virtual network and subnet as the SQL Server. Finally, make sure that the Azure Batch pool is configured to use the correct DNS settings. The pool should be configured to use the same DNS server as the SQL Server.
    This will ensure that the pool can resolve the hostname of the SQL Server and establish a connection. If you have checked all of these settings and are still unable to connect to the SQL Server from the Azure Batch pool, you may want to check the logs on both the SQL Server and the Azure Batch pool to see if there are any error messages that can help you diagnose the issue.

    I have answered this assuming that you are using SQL server on an azure VM.

    I hope this helps you troubleshoot the issue. If you have any further questions or concerns, please let me know.

    0 comments No comments