How to programmatically determine whether a VM size is previous-gen

Lyly Vuu 0 Reputation points
2024-10-01T10:06:27.4866667+00:00

This documentation describes VM series are that previous-gen: https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/previous-gen-sizes-list

For every VM in our tenant, we are looking to programmatically determine the VM "status" (e.g. capacity limited, next-gen available, or retired). There doesn't appear to be an API that will return this information. Please advise on the best method to obtain this information. Thank you in advance.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,872 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jackson Martins 10,551 Reputation points MVP
    2024-10-01T14:04:48.24+00:00

    Hello @Lyly Vuu

    You can use the Azure Advisor "Service Retirement" workbook for filtering affected resources by subscription, resource group, or location.

    Go to Azure Advisor, select workbooks and Service Retirement:

    User's image

    After that, at the workbook's top, you will see a dropdown menu labeled Subscription.
    Click on it and select the desired subscription to view only the resources under that subscription.
    Just like:

    User's image

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.