How can I temporarly stop paying for SQL Server Pay-as-you-go license hosted on Azure VM..?

Shivendoo Kumar 751 Reputation points
2020-08-10T23:47:36.51+00:00

Hi All,

I have SQL Server 2016 hosted on Azure VM. We installed VM and SQL Server from Marketplace and we are using pay-as-you-go license. I want to stop paying for SQL Server License for couple of days/weeks.

How can I do this..?

Do I need to stop SQL Sever completely? is that all..?

Expert/Gurus please advise.

SQL Server on Azure Virtual Machines
{count} votes

Accepted answer
  1. Ronen Ariely 15,206 Reputation points
    2020-08-12T13:06:57.587+00:00

    Good day @prmanhas-MSFT

    If I understand the question correctly then the OP ask about SQL Server on Virtual machine and your response was about Azure SQL Database.

    Moreover (assuming we are speaking on Azure Database)...

    use the import/export service to export a copy of your DB to blob storage

    This is a very bad idea in my opinion. import/export create a copy and not a point in time backup. you might lose data or get inconsistent data! I highly recommend to search a recording of one of my lectures regarding the internals of bacpac files - there are versions online in Hebrew and English.

    change the service tier to Basic to minimize your bill.

    This is the only clear way which should be done in most cases.

    drop it and restore

    This is great solution (as you wrote) in some cases. This is a real backup/restore and it is safe to be used (no data lose like in bacpac option for example) as long as your backups are still available (azure keep the backup for limited time)

    If weeks then exporting the database and importing when needed is another option.

    Again, Highly NOT recommended if you cannot confirm that no data was lost, as explain above.

    Azure SQL Database Serverless

    This is a great solution for most cases that we need Azure Database to be used for short time from time to time, like the one described here (if it was about Azure Database). This service was designed for such cases, but this mean that we are NOT using SQL Server on VM but a database level service which is totally different level of control.


    ### Good day @vendooKumar-8455

    How can I temporarly stop paying for SQL Server Pay-as-you-go license hosted on Azure VM

    You cannot. Even when the VM is closed you still pay for the SQL Server licence.

    I want to stop paying for SQL Server License for couple of days/weeks.

    You can backup the VM -> remove the VM -> restore the VM

    It is very complex solution, which personally I did not find any scenario that might fit this option yet, but it is an option, so you should know about it and check if this fit your needs.

    SO, What next?

    (1) Use the right edition with lower cost, which fit your needs

    If you use the server only for development and tests, then use the freely licensed SQL Server Developer edition.

    If you only need lightweight production (less than 4 cores, less than 1 GB memory, less than 10 GB for each database), then use the freely licensed SQL Server Express edition.

    For Small web sites use SQL Server web edition

    For small needs use Standard edition

    Obviously if these editions do not cover your needs, then you will need to use the Enterprise edition.

    (2) The licensing cost of SQL Server is directly related to the number of vCPUs.

    Choose the smaller VM size that matches your needs. When you do not use the Server then you can change the tier to a smaller one with one or less than one vCPU.

    Important!!!

    For most cases which really need this behavior you should probably use Azure SQL Database instead of SQL Server on Virtual Machine. Check this option! Without moire information it sound like this might fit your needs. In this case, read what I wrote above regarding reducing the cost in Azure Database (my respond to prmanhas)

    3 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. prmanhas-MSFT 17,946 Reputation points Microsoft Employee Moderator
    2020-08-11T09:07:08+00:00

    @Shivendoo Kumar Thank you for your query.

    We have several ways to achieve what you are looking for.

    One is to use the import/export service to export a copy of your DB to blob storage, and another is to change the service tier to Basic to minimize your bill.

    You can refer to this article for more information.

    Another approach depends upon how long you want to stop it and how immediately you want it and the size of the database. If it is for a couple hours then it may not worth it because the billing is hourly and you may have round off issues. If days then you can drop it and restore when needed. If weeks then exporting the database and importing when needed is another option. Also you may want to check backup strategy for the edition you choose before preferring export / restore but it is not recommended.

    One more choice is to use Azure SQL Database Serverless. The Serverless option provides great flexibility and does not bill unless it is actually getting used. This is great for databases that get low usage over time. The startup time after it goes into standby is a factor to take into account however. For Developmental purposes, this is excellent however.

    You can refer to this article as well for more information.

    Hope it helps.

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.

    Thanks

    3 people found this answer helpful.
    0 comments No comments

  2. Shivendoo Kumar 751 Reputation points
    2020-08-13T03:03:29.327+00:00

    Actually, I stopped the VM and now my VM Status is Stopped (Deallocated) and I think I will not be charged for SQL License and VM (Computation). I will be only charged to STORAGE.

    I found this and wanted to add here:

    https://stackoverflow.com/questions/41932934/azure-vm-software-cost-when-vm-stopped

    https://azure.microsoft.com/en-gb/pricing/details/virtual-machines/sql-server-enterprise/
    17373-capture36.png

    1 person found this answer helpful.
    0 comments No comments

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.