This article is contributed. See the original author and article here.

Today, we got a new service request that our customer implemented a private link and they want to use External tables. 


Unfortunately, when they enabled the option “Deny public network access” they are not able to connect: Connection was denied since Deny Public Network Access is set to Yes


 


Our customer implemented the following steps: 



  • Create Master KEY

  • Create Database Scoped Credential

  • Create External Data Source with this parameters :




    •    LOCATION=’servername.database.windows.net’,

    •    DATABASE_NAME = ‘databasename’,

    •    CREDENTIAL = AppCredential




  • Create External database from the data source


 


When we tried to perform a select from the first database they faced the following message:”Error retrieving data from servername.database.windows.net  The underlying error message received was: ‘A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)”.


 


We need to explain that the connection will be made using the external IP of the node that the server is running and not the private IP. For this reason, you need to use the external connection or use Managed Instance that is possible to connect among databases that are running in the same instance. 


 


Enjoy!

Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.