cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

IP address configuration for databricks workspace

Shiva4266
New Contributor II

Hi All Im running the below code in notebook but always returns 400 error even though everything seems correct, Can you please help me how to see the current IP address list or enable the IP access list for the databricks workspace

your help will be appreciated. Also help me where to run the CLI commands from azure cloud instead of downloading the databricks CLi locally and then connecting to Azure databricks?

 

import requests

 
workspace_url = "https:/databricksworkspaceid.azuredatabricks.net"  
token = "PAT Token"  

# API endpoint
url = f"{workspace_url}/api/2.0/ip-access-lists"

# Authorization headers
headers = {
    "Authorization": f"Bearer {token}"
}

print(url)
response = requests.get(url, headers=headers)
print(response)
2 REPLIES 2

Shua42
Databricks Employee
Databricks Employee

Hi @Shiva4266 ,

You can view the IP access lists in the UI in the account console for account IP access control, if you go to the account console > Settings > Security and compliance > IP Access List.

A few other things to check:

- IP Access List control is only for Enterprise account, so make sure your account on the Enterprise tier if you are running into issue.

- The API can only be used by an account admin, so only be sure that you are.

You can run commands in the Azure shell at shell.azure.com. Just pip install the databricks cli with 'pip install databricks-cli' and then run as you would locally.

Shiva4266
New Contributor II

HI @Shua42  - I tried installing the CLI and tried providing the necessary commands from the below documentation, but workspace commands are not working as workspace -conf is not working , can you help here 

Link - Configure IP access lists for workspaces | Databricks Documentation

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now