There was several bugs found when trying to create a job ( didnt know if should have raised seperate tickets)
summarised below
Jobs missing steps that had been created
Deleted job still showing even after refresh and alllowing access to edit
Couldn't save change to job step on success action - stayed the same
Job owner was showing incorrectly between Azure Data Studio and management studio
Steps to Reproduce:
Create a new SQL Agent Job - Click + New Job
2 Add new step add details and click OK
[Note can't use the Run As box will not select anything]
3 Click ok
4 I realised at this point I should have gone into and edited the job to step to complete. Filter the job and Edit job
5 I noticed recreating these steps another issue has occurred, going back into edit the job it shows as there are 0 steps
Management studio disagrees
6 Click on Edit Job the job owner i set as SA is showing as my AD account (obfuscated to remove company details)
however as you can see management studio shows correctly
7 I delete the job through management studio, refresh and it is no longer there. I go back in Azure Data studio and hit refresh and it still shows the job. I redo the filter to "test job" and it still appears. I can click on it and it allows me to edit it, however it wont let me save it.
Microsoft.SqlServer.Management.Smo.FailedOperationException: Attempt to retrieve data for object failed for Server 'FCL-SQL-VC200A'. ---> Microsoft.SqlServer.Management.Smo.MissingObjectException: The Job 'Test Job' does not exist on the server. at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn) at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn) at Microsoft.SqlTools.ServiceLayer.Agent.JobData.get_Job() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 688 at Microsoft.SqlTools.ServiceLayer.Agent.JobData.CheckAndLoadGeneralData() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 762 at Microsoft.SqlTools.ServiceLayer.Agent.JobData..ctor(CDataContainer data, AgentJobInfo jobInfo, ConfigAction configAction) in D:\a\1\s\src\Microsoft.SqlTools.Service...
I try and recreate the job and the same thing occurs.
My original issue was I was unable to change the job step to quite the job reporting success as each time I did it did not save the change.
Version: 1.5.1-insider (user setup) Commit: 31614247cf341abc9194080d0ab7eb720257fb06 Date: 2019-03-13T21:24:09.603Z VS Code 1.30.1 Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Windows_NT x64 6.1.7601
There was several bugs found when trying to create a job ( didnt know if should have raised seperate tickets)
Jobs missing steps that had been created
Deleted job still showing even after refresh and alllowing access to edit
Couldn't save change to job step on success action - stayed the same
Job owner was showing incorrectly between Azure Data Studio and management studio
Steps to Reproduce:
[Note can't use the Run As box will not select anything] 3 Click ok
4 I realised at this point I should have gone into and edited the job to step to complete. Filter the job and Edit job
5 I noticed recreating these steps another issue has occurred, going back into edit the job it shows as there are 0 steps
Management studio disagrees
6 Click on Edit Job the job owner i set as SA is showing as my AD account (obfuscated to remove company details)
however as you can see management studio shows correctly
7 I delete the job through management studio, refresh and it is no longer there. I go back in Azure Data studio and hit refresh and it still shows the job. I redo the filter to "test job" and it still appears. I can click on it and it allows me to edit it, however it wont let me save it.
Microsoft.SqlServer.Management.Smo.FailedOperationException: Attempt to retrieve data for object failed for Server 'FCL-SQL-VC200A'. ---> Microsoft.SqlServer.Management.Smo.MissingObjectException: The Job 'Test Job' does not exist on the server. at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn) at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn) at Microsoft.SqlTools.ServiceLayer.Agent.JobData.get_Job() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 688 at Microsoft.SqlTools.ServiceLayer.Agent.JobData.CheckAndLoadGeneralData() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 762 at Microsoft.SqlTools.ServiceLayer.Agent.JobData..ctor(CDataContainer data, AgentJobInfo jobInfo, ConfigAction configAction) in D:\a\1\s\src\Microsoft.SqlTools.Service...
I try and recreate the job and the same thing occurs.
My original issue was I was unable to change the job step to quite the job reporting success as each time I did it did not save the change.