I understand that you want to identify the VMs which have images that are scheduled for deprecation.
There are multiple methods available for this which are outlined here. This page also walks you through how to migrate to a custom image or a different version.
Let me know if you still have questions or issues and I will be happy to assist.
If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.
If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.
Thank you for helping to improve Microsoft Q&A!