How did my Azure bill get this high?

chrisrdba 471 Reputation points
2022-05-27T18:05:56.997+00:00

Greetings. I use a General Purpose, Serverless, Azure SQL DB for training purposes with all configurations set as low as they can get. It's set to auto pause after an hour of inactivity.

On 05/ 04 it was forcasted that my cost would be < $80 for the month. If I hit 20 hours of use in those 23 days I'd be amazed, likely closer to 10.

As of today my bill is $184. All resources have been totally flat for the last week, but Im still being billed $10 a day.

How can I be sure auto pause was working? Anything else I can check to stop this from happening again?

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

Accepted answer
  1. Oury Ba-MSFT 20,936 Reputation points Microsoft Employee Moderator
    2022-05-27T21:41:23.89+00:00

    Hi @chrisrdba Thank you for posting your question on Microsoft Q&A and for using Azure services.

    My understanding is that you are getting high cost on your Azure SQL Database hyperscale serverless even though you set all configurations as low. And you also mentioned that it is set to auto pause after an hour of inactivity.
    *How can be sure that auto-pause is working? *

    The following features do not support auto-pausing but do support auto-scaling. If any of the following features are used, then auto-pausing must be disabled, and the database will remain online regardless of the duration of database inactivity:

    • Geo-replication (active geo-replication and auto-failover groups).
    • Long-term backup retention (LTR).
    • The sync database used in SQL Data Sync. Unlike sync databases, hub and member databases support auto-pausing.
    • DNS alias created for the logical server containing a serverless database.
    • Elastic Jobs (preview), when the job database is a serverless database. Databases targeted by elastic jobs support auto-pausing and will be resumed by job connections.

    If auto-pausing is enabled, but a database does not auto-pause after the delay period, and the features listed above are not used, the application or user sessions may be preventing auto-pausing. To see if there are any application or user sessions currently connected to the database, connect to the database using any client tool, and execute the following query:

    SELECT session_id,
    host_name,
    program_name,
    client_interface_name,
    login_name,
    status,
    login_time,
    last_request_start_time,
    last_request_end_time
    FROM sys.dm_exec_sessions AS s
    INNER JOIN sys.dm_resource_governor_workload_groups AS wg
    ON s.group_id = wg.group_id
    WHERE s.session_id <> @@SPID
    AND
    (
    (
    wg.name like 'UserPrimaryGroup.DB%'
    AND
    TRY_CAST(RIGHT(wg.name, LEN(wg.name) - LEN('UserPrimaryGroup.DB') - 2) AS int) = DB_ID()
    )
    OR
    wg.name = 'DACGroup'
    );
    If the result set is non-empty, it indicates that there are sessions currently preventing auto-pausing.

    Regards,
    Oury


1 additional answer

Sort by: Most helpful
  1. Oury Ba-MSFT 20,936 Reputation points Microsoft Employee Moderator
    2022-05-27T21:59:01.06+00:00

    Hi @chrisrdba in addition to the above answer. The cost for a serverless database is the summation of the compute cost and storage cost.
    When the database is paused, the compute cost is zero and only storage costs are incurred.
    You can use Azure cost Management to monitor use of cost alerts usage and spending

    **Resource: **

    Azure Database Pricing
    Azure SQL Database Serverless

    Please let us know if you have further queries

    Regards,
    Oury


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.