- You can use the Azure synapse REST API to get the list of notebooks available in the synapse workspace. The following is an image showing the available notebooks in my synapse workspace along with the code that you can use to achieve your requirement.

#install msal using !pip install msal for getting bearer token
import msal
client_id = "<client_id>"
authority = "https://login.microsoftonline.com/<tenant_id>"
client_secret = "<client_secret>"
# Create a ConfidentialClientApplication instance
app = msal.ConfidentialClientApplication(client_id=client_id, authority=authority, client_credential=client_secret)
# Get the token
scopes = ["https://dev.azuresynapse.net/.default"]
result = app.acquire_token_for_client(scopes=scopes)
print(result)

- Call the synapse Rest API using python's requests library (GET method).
import requests
response = requests.get("https://synapse3003.dev.azuresynapse.net/notebooks?api-version=2020-12-01", headers = {"Authorization":f"Bearer {result['access_token']}"}).json()
print(len(response['value']))
for i in response['value']:
print(i)

NOTE: You need to create a service principle by navigating to azure AD-> App registration. After that go to your synapse studio->manage tab->Access control and then add your service principle with appropriate role to create token as in above procedure.