Hello @phemanth ,
Did you manage to get your proposed code to run in your environment?
I told you that we have DEP and VNet activated and that to my understanding it should not be possible to access dev.azure.com from the driver node of a Synapse Spark Notebook. At least not if there is no private endpoint and I don't know how to create one to a public internet address; I only know how to create MPEs to specific Azure resources (and Azure DevOps is not on the list).
I still tried to access Azure DevOps REST API from a Synapse notebook, and it failed as expected:
import requests
def check_azure_devops_api_access(organization, personal_access_token):
url = f"https://dev.azure.com/{organization}/_apis/projects?api-version=6.0"
headers = {
"Content-Type": "application/json",
"Authorization": f"Basic {personal_access_token}"
}
try:
response = requests.get(url, headers=headers)
if response.status_code == 200:
print("Azure DevOps REST API is accessible.")
else:
print(f"Received unexpected status code {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
check_azure_devops_api_access("...", "...")
>>> An error occurred: HTTPSConnectionPool(host='dev.azure.com', port=443): Max retries exceeded with url: /provinzial/_apis/projects?api-version=6.0 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x76b716b7db70>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
I used the browser dev tools to inspect the traffic to/from Synapse Studio. I have the impression that the Git integration is solely on the client side, meaning that the client (customers laptop) accessing Synapse Studio also downloads the artifacts from the Git repo directly to the client. If a notebook is started, the notebooks are "uploaded" to the driver. This way, the driver would not need to be able to access the Git repo (or know anything about the currently selected Git branch). If this is true, I doubt that there will be any way to obtain the name of the Git branch currently selected in Synapse Studio programatically.
@phemanth don't get me wrong, but I have the impression that you only paste our conversation to ChatGPT and post it's responses here. To answer my question it requires some deeper knowledge from the Product Group who are familiar with Synapse's Git integration in detail. Can you reach out to a person like that or do I need to create a support request for this?