While running the Azure Synapse notebook, cannot connect to the SQL Database. An exception is thrown each time during production execution. Adding an IP address range to configure a firewall rule manually. Need a feasible solution.

Rosy Ray 20 Reputation points
2023-06-21T15:25:43.5966667+00:00

Activity: Move and transform > copy data

SQL Databases > Networking > Firewall rules

While running the Azure Synapse notebook, I cannot connect to the SQL Database. An exception is thrown each time during production execution. I need to add an IP address range manually to configure a firewall rule. Need a feasible solution.

ErrorCode: SQL failed to connect

Type: Microsoft Data Transfer Common Shared Hybrid Delivery Exception Message: Cannot connect to SQL Database. Cannot open server requested by the login. Client with IP address xx.xx.xx.xx is not allowed to access the server. To enable access, use the Windows 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. Check the linked service configuration.

FailureType: UserError

Target: Copy to DB

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2023-06-22T06:58:44.07+00:00

    @Rosy Ray - Thanks for the question and using MS Q&A platform.

    It sounds like you are experiencing an issue connecting to your SQL Database from an Azure Synapse notebook. The error message indicates that the IP address of the client running the notebook is not allowed to access the SQL Database due to a firewall rule.

    To resolve this issue, you can add the IP address of the client running the notebook to the firewall rules for your SQL Database. Here are the steps to do this:

    1. Go to the Azure portal and navigate to your SQL Database.
    2. Under Security => Click on Networking
    3. Click on "Add client IP" to add the IP address of the client running the notebook to the firewall rules.
    4. If you need to add a range of IP addresses, you can click on "Add IP range" and enter the start and end IP addresses.
    5. Click "Save" to save the new firewall rule.

    User's image

    Once you have added the IP address or IP range to the firewall rules, you should be able to connect to your SQL Database from the Azure Synapse notebook without any issues.

    If you are still experiencing issues connecting to your SQL Database, you may need to check the linked service configuration in your Azure Synapse notebook to ensure that it is configured correctly.

    For more details, refer to Azure SQL Database and Azure Synapse IP firewall rules.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.