How to get the stopped virtual machines pricing for hours or seconds ?

Eugene Huang 5 Reputation points

From the API documentation,a virtual machine which is stopped but not deallocated means that resources are still attached and I am still getting charged for the resources.

And I want to know if there is any api or documentation to show the price of the stopped vms for every hours or seconds?


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

3 answers

Sort by: Most helpful
  1. TP 44,776 Reputation points


    The Compute price for VM in Stopped state is the same as VM in Running state. In other words, since the host resources are allocated and thus not usable by a another customer you are charged even if the VM isn't running. If I'm not understanding your question properly please add a comment to clarify.

    Please click Accept Answer if the above was useful.



  2. Dillon Silzer 45,871 Reputation points

    Hello Eugene,

    Just to give some more information on the states please see:

    The virtual machine resource - power states and billing

    The state of the virtual machine impacts whether the virtual machine resource is being billed or not, in relation to the virtual machine resource and its reliance and use of underlying hardware.

    Running - The virtual machine is powered up and working, and currently being billed for.

    Stopped - The VM has been shut down from within the guest operating system or using PowerOff APIs. The VM will be showing as Stopped. This does not release the lease that the VM has on the underlying hardware, which means the hardware is unavailable for other customers. In this state, the virtual machine is still billed for.

    Deallocated - The VM has released the lease on the underlying hardware and is completely powered off, so the virtual machine resource is not billed. It will appear in the Azure portal as Stopped (Deallocated).

    Cited from

    If this is helpful please accept answer.

    0 comments No comments

  3. vipullag-MSFT 21,351 Reputation points Microsoft Employee

    Hello Eugene Huang
    We noticed your have rated low on one of the answer as not helpful. Thank you for taking time to share feedback.

    If the virtual machine is deallocated, it should not incur any compute charges. However, storage charges may still apply for the disks attached to the VM.

    Regarding the cost difference between a stopped VM and a running VM of the same type during the same time period, there could be several factors that contribute to the difference in cost. For example, if the VM is part of a virtual machine scale set, the cost may vary depending on the number of instances running at any given time. Additionally, if the VM is using premium storage, the cost may be higher than if it were using standard storage.

    To figure out the cost of a VM, you can use the Azure Pricing Calculator. The calculator allows you to estimate the cost of running a VM based on factors such as the VM size, storage type and size, and the region where the VM is located. You can also use the Azure Cost Management and Billing service to monitor and analyze your Azure spending. The service provides detailed reports and insights into your usage and costs, and allows you to set budgets and alerts to help you manage your spending.

    I hope this helps.
    If the answer is helpful, request you to take a resurvey.

    0 comments No comments