Search code examples
c#azureazure-sql-databaseazure-billing-api

Receive notifications when a user increase the SQL database size


We would like to receive notifications once the user change SQL Server size from S9 to S12 (increase). Is this possible natively or can we develop custom webhooks to receive notifications?


Solution

  • Use the Usage and the RateCard APIs to get estimated cloud consumption and charges. Usage API will get you a metricID which you can use in query using RateCard to predict the price,

    https://learn.microsoft.com/bs-cyrl-ba/azure/billing/billing-usage-rate-card-overview

    Sample is here

    Another Option would be to create custom Azure Policy to audit SQL SKUs and then create an alert once the resource is not compliant with the Azure policy to notify users.

    https://learn.microsoft.com/en-us/azure/governance/policy/samples/allowed-sql-db-skus