Is there any way to identity if Azure is paygo or not. Using metadata or any API call?

Diksha Singh 60 Reputation points

We want to identify if the Azure VM is paygo type or not. Do we get any billing information using metadata URL or API call?

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,312 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vlad Costa 860 Reputation points

    Hi Diksha,

    By checking your Azure subscription bill, you can identify if your Azure VM is Pay-as-you-go (PAYG).

    Here are the steps to do that:

    1. Sign in to the Azure portal.
    2. Type subscriptions in the search box and then select Subscriptions.
    3. In the list of subscriptions, select the subscription you want to check.
    4. Under Billing, select Invoices.
    5. In the list of invoices, look for the one you want to download, then select the download symbol. This action opens the Download Usage + Charges window, where you can select Download CSV and Download invoice.
    6. The detailed usage CSV file shows your charges by billing period and daily usage. If you see charges for your VM usage, your VM is likely on a PAYG.

    You might want to look into the Azure Billing APIs for billing information.

    If this answers your question, please click Accept Answer and Yes if this answer was helpful. Doing so would help other community members with similar issues identify the solution. I highly appreciate your contribution to the community.

  2. SadiqhAhmed-MSFT 40,911 Reputation points Microsoft Employee

    @Diksha Singh I'm not entirely sure what you mean by "metadata URLs" in this context, but I'll do my best to provide you with information about Pay-As-You-Go subscriptions in Azure.

    A Pay-As-You-Go subscription is a flexible and cost-effective way to use Azure services. With this type of subscription, you pay only for the services you use, and there are no upfront costs or termination fees. You can use any Azure service that is available in your region, and you can scale up or down as needed.

    As for metadata URLs, I'm not sure how they relate to Pay-As-You-Go subscriptions. Metadata URLs are typically used to provide information about a resource in Azure, such as a virtual machine or storage account. If you can provide more information about what you're looking for, I may be able to provide a more specific answer.

    Hope this helps!


    The subscription GET API will not give the offer id for the subscription however it has the parameter quotaId which will show it as PayAsYouGo/Enterprise/MSDNDev/Test to determine if the subscription is Pay-As-You-Go (PayG). 

    However, this quoteid will be same for MCA FL (Enterprise) and EA legacy, MCA CL (PayG) and legacy PayG will be same. 

    Another way is if the subscription has usage, you can run this API to fetch usage

    and in the usage record we have offerId available which you can get to know what type of offer the subscription is.

    Hope this helps. Let us know if you need any further assistance in this matter!

    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments