Do we have a solution in python to list job runs that are created using Azure VM managed identity in Azure Databricks.
Appreciate the help!
I am getting http 403 error when using managed identity library in python
from azure.identity import ManagedIdentityCredential
credential = ManagedIdentityCredential()
# Obtain an access token
from azure.identity import DefaultAzureCredential
credentials = DefaultAzureCredential()
access_token = credentials.get_token("management.azure.com/")
headers = { 'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/json' }
# Set the URL for the Databricks REST API
endpoint url = "databricks_url" + '/api/2.0/clusters/list'
# Make the REST API call to the Databricks endpoint
response = requests.get(url, headers=headers)
print(response.json())