cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Debugging notebook access to external REST API

phguk
New Contributor III

I'm using a Python Notebook with a REST API to access a system outside Databricks, in this case it's to call a SAS program. Identical python code works fine if I call it from jupyter on my laptop, but fails with a timeout when I run it from my Databricks notebook. This leads me to think I've not enabled something between the notebook & the external SAS system. My admin has already whitelisted AzureDatabricks' service tag to SAS (is this the correct approach?), so we assume any outbound connection attempt would succeed. Are there any other actions needed to allow a notebook using python to initiate an outbound connection to an external location ? 

Also can you suggest additional logging/debugging tools & techniques I can use to explore what is failing ? I can ping the target url so there appears to be a working route. 

Thanks in advance. 

5 REPLIES 5

Walter_C
Databricks Employee
Databricks Employee

Can you share the error message that is being received on the notebook?

phguk
New Contributor III

Here's what I see ...

Walter_C
Databricks Employee
Databricks Employee

Also can you please confirm if you are using a shared cluster for the execution of the same? If yes, could you please try the same test by using a single user cluster?

phguk
New Contributor III

I'm running Dedicated/Single cluster, thanks

Walter_C
Databricks Employee
Databricks Employee

What happens if you run command in notebook:

nc -vz hostname 443

If it fails to connect this will mean that the firewall or security groups associated with the VPC or VNet are not allowing this connection, you will need to check with your networking team