Azure Data Factory - SQL connectivity error: Cannot connect to SQL database: `Error Code:40615` , Error Message: Cannot open server - requested by the login. Client with IP address ;xx.xxx.33.145; is not allowed to access the server

Gulab Singh 46 Reputation points Microsoft Employee
2021-03-29T17:00:29.467+00:00

While trying to establish connection from Azure Data factory to Azure SQL, getting below error message. Please assist...

Error code=40615

Error Message: {'StatusCode':'DFExecutorUserError','Message':'Job failed due to reason: at Source 'source1': java.lang.RuntimeException: Cannot connect to SQL database: 'jdbc:sqlserver://sql-xxxserver.database.windows.net;database={xxxManage}', 'User: xxxtransition'.[SQL Exception] Error Code:40615 , Error Message: Cannot open server 'sql-xxxerver' requested by the login. Client with IP address 'xx.xxx.33.145' 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. It may take up to five minutes for this change to take effect.

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,539 questions
0 comments No comments
{count} votes

Accepted answer
  1. KranthiPakala-MSFT 46,422 Reputation points Microsoft Employee
    2021-03-29T22:28:56.437+00:00

    Hi @GarrySingh-4786,

    Welcome to Microsoft Q&A forum and thanks for reaching out. In addition to @Nandan Hegde 's response, please see below related information:

    By looking at the error message and the error code, below could be the possible root case and resolution for the issue.

    Error code=40615

    • Possible root cause:
      ADF Azure IR unable to connect to Azure SQL server with firewall enabled. IP address mentioned in the error message has not been whitelisted.
    • Possible resolution/workaround:
      a). As the Azure IR IP Ranges gets updated weekly basis, new Azure IP range of the region should be whitelisted if this error is noticed. For more info about Azure IR IP range please refer to this doc : Azure Integration Runtime IP addresses: Specific regions
      b). Another option is to Turned OFF Allow all Azure Services in SQL Server firewall Settings. In case if your corporate policy don’t allow you to turn off Allow Azure Services in SQL Server Settings, then you will have to create Azure IR within managed Virtual Network and establish a Private Endpoint connection from ADF to Azure SQL Server and then used Managed VNET Integration Runtime to run the pipeline.

    Additional information:
    Here are couple of helpful resources related to connectivity issues and ADF Managed Virtual Network with Private Endpoint.

    Hope this information helps. Do let us know if you have further query.

    ----------

    Thank you
    Please do consider to click on "Accept Answer" and "Upvote" on the post that helps you, as it can be beneficial to other community members.

    3 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nandan Hegde 29,886 Reputation points MVP
    2021-03-29T17:14:16.207+00:00

    Hey, there can be multiple reasons for that.some if them are as below:

    1. check whether the allow azure service property is enabled in Azure SQL server.
      If not then you would have to white list the IP range of the region in which the ADF is created
    2. in case if your source or sink is leveraging an integration runtime,then the azure database must also be accessible from the IR

    Can you please provide the source and sine details of your adf

    1 person found this answer helpful.
    0 comments No comments