Forum Discussion
Does anyone knows how to run a http call in a notebook
- 1 year ago
Hi Jeanxyz,
You can run HTTP calls directly from a notebook in Microsoft Fabric using Python, and it's straightforward if you use the popular requests library. This approach works in both Spark and non-Spark Python environments.
import requests url = "https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/sqlEndpoints/{sqlEndpointId}/refreshMetadata" headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN" } response = requests.post(url, headers=headers) print(response.status_code) print(response.text)Replace {workspaceId}, {sqlEndpointId}, and YOUR_ACCESS_TOKEN with your actual values. You must provide a valid Azure AD access token, this usually involves authentication, which can be handled via Azure Identity, MSAL, or other SDKs that you may already use for automation.
Hope that helps
Onur
😊If this post helped you, feel free to give it some Kudos! 👍
✅And if it answered your question, please mark it as the accepted solution.
Hi Jeanxyz
We would like to confirm whether the issue has been resolved. If it is still outstanding, please share any additional information so we can assist you further.
Thank you.