Forum Discussion
Microsoft fabric notebook - to execute notebook externally using rest api
- 1 year ago
Hi shivam_dalvi,
Below is an example with C# to acquire the access token, you might be able to adapt that to Python/PySpark code in your Fabric Notebook:
Here is another example how in concept this should work:
https://stackoverflow.com/questions/75751477/how-to-get-a-microsoft-azure-authorization-token
Hope this helps to get you started?
Hi shivam_dalvi,
Below is an example with C# to acquire the access token, you might be able to adapt that to Python/PySpark code in your Fabric Notebook:
Here is another example how in concept this should work:
https://stackoverflow.com/questions/75751477/how-to-get-a-microsoft-azure-authorization-token
Hope this helps to get you started?
hey hi Expiscornovus, even if we use the AAD to get tokens for requesting the api but in response what if we want to understand whether the notebook triggered is in progress, completed or failed?. As of now the response is either 202 Accepted or if there's any error, instead can we get jobInstanceId so that we can track the status of the job using the below api mentioned in doc https://learn.microsoft.com/en-us/rest/api/fabric/core/job-scheduler/get-item-job-instance?tabs=HTTP
- Kalyanallur1 year agoNew Member
You can use GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/jobs/instances/ to see status of job, request to this url if you are running notebook, every 30 second you can check status in the return response value