Forum Discussion
Not able to delete a job instance using the Delete API
Hi,
I am trying to delete a job instance that is a part of SJD in my workspace. When I use GET call on the job instance id i am able to fetch the details but the DELETE call is giving 404 not found for the same id.
How can I resolve this? Is there no delete API call for this purpose?
Hi ISHPREETKaur
Sorry to know it didn't work!
Could you try creating a SJD using Fabric UI, then deleting it using the REST API using the process above? This will rule out if anything is wrong in the creation process.
12 Replies
- tayloramySuper User
Hi ISHPREETKaur,
Why do you want to delete the job instance? The job instance is just a history that the job has run. After 30 days or so the service will purge it automatically.
There is no API for deleting a job instance: https://learn.microsoft.com/en-us/rest/api/fabric/core/job-scheduler
Are you wanting to delete the schedule itself?
- ISHPREETKaurMicrosoft Employee
I want to delete a particular SJD but I am not able to delete it as there are job instances attached to it. When I try to delete a SJD with job instances attached the API is returning an error like:
This is why I want to delete all the instances associated with the job and then delete the SJD ultimately as I tried deleting an SJD with no job instances associated with it and it got deleted but this one gives an error.
- deborshi_nagSuper User
Hello ISHPREETKaur
I have been able to delete SJD using the REST API, even though it had job instances linked to it. You must have Write permissions on the Spark Job Definition to be able to delete it.
If you have created a SJD using your identity, you can try the REST API directly using the links below.
Lists SJD for your workspace
Items - List Spark Job Definitions - REST API (SparkJobDefinition) | Microsoft Learn
Deletes SJD using Id from the above link.
Items - Delete Spark Job Definition - REST API (SparkJobDefinition) | Microsoft Learn
- tayloramySuper User
Hi ISHPREETKaur,
The job instances in the Scheduler module are by design read only, you can't delete them. They are a history of what has run in the service.
If the goal is to delete the spark job, can you share exactly what error you are getting while trying to delete it?
As deborshi_nag said, they are usually fairly easy to delete using the API.
- v-saisrao-msftCommunity Support
Hi ISHPREETKaur,
Have you had a chance to review the solution we shared by tayloramy deborshi_nag ? If the issue persists, feel free to reply so we can help further.
Thank you.