Hello, @Mojahedi, D. (Davood) ! I reached out to the Azure Batch team and their recommendation was to use the ComputeNodeInformation
property as described below.
How can I find out if a specific task was preempted or not while using Azure Batch?
You are able to get the task and look at the ComputeNodeInformation
property:
https://learn.microsoft.com/en-us/rest/api/batchservice/task/get?view=rest-batchservice-2023-05-01
This will allow you to find out which Batch compute node the task ran on. You can then query the VM for its current state (querying past state is not available). You would need to use a Batch monitoring solution to construct past state if that's required.
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!