Databricks API call to GitHub failing with 403 Forbidden error

Disable the IP allow list in GitHub.

Written by monica.cao

Last published at: January 30th, 2025

Problem

When making an API call from a Python notebook to GitHub to fetch issues, you receive a 403 Forbidden error.  

 

Cause

The GitHub organization has an IP allow list enabled. This setting restricts access from Databricks workspace IP addresses. 

 

Solution

Disable the IP allow list in GitHub.

  1. In GitHub, navigate to your organization.
  2. Click on the Settings tab.
  3. Under Security, select Security settings.
  4. Scroll down to the IP allowlist section. This is where you manage the allowed IP addresses for your organization.
  5. Click the Disable IP allowlist option. 

If your security policies require the IP allow list to be enabled, add the Databricks Control Plane NAT IP to the IP allowlist. This will allow traffic from Databricks to access the GitHub API without being blocked.

For more information, refer to the GitHub Managing allowed IP addresses for your organization documentation.