Wednesday, 12 December 2018

Azure SQL Pricing pattern

Azure pricing can be quite complex to understand at times. This blog focuses on specifically Azure SQL Pricing models.

Azure SQL Pricing Models

vCore Purchase Model - The vCore purchasing model offers trade off for performance and storage. has two performance tiers, which are General Purpose (GP) and Business Critical (BC). 

DTU Purchase Model - This model offers SQL Azure in three tiers namely Basic Tier, Standard Tier, Premium Tier.

DTU Pricing Model Standard Tier





       Premium service tier - Following table illustrates included storage and max storage options.



Suppose an S3 database has provisioned 1 TB. The amount of storage included for S3 is 250 GB, and so the extra storage amount is 1024 GB – 250 GB = 774 GB. The unit price for extra storage in the Standard tier is approximately ₹16.86/GB/month, and so the extra storage price is 774 GB * ₹16.86/GB/month = ₹13,045.42/month. Therefore, the total price for the S3 database is ₹10,116.88/month for DTUs + ₹13,045.42/month for extra storage = ₹23,162.30/month.
Suppose a 125 eDTU Premium pool has provisioned 1 TB. The amount of storage included for a 125 eDTU Premium pool is 250 GB, and so the extra storage amount is 1024 GB – 250 GB = 774 GB. The unit price for extra storage in the Premium tier is approximately ₹33.71/GB/month, and so the extra storage price is 774 GB * ₹33.71/GB/month = ₹26,090.84/month. Therefore, the total price for the pool is ₹51,743.39/month for pool eDTUs + ₹26,090.84/month for extra storage = ₹77,834.22/month.

One should always know about their workloads expected during given period of time and choose accordingly which type of purchase option will be good for their application.



Implement swagger in API Definitions

API's are crucial part of any project now a days. Swagger is visualization tool for understanding API signature and functionality in real-time. Swagger is a language-agnostic specification for describing REST APIs. It allows both computers and humans to understand the capabilities of a service without any direct access to implementation (source code, network access, documentation). One goal is to minimize the amount of work needed to connect disassociated services. Another goal is to reduce the amount of time needed to accurately document a service.

Steps to implement swagger in .NET core

  • From the Manage NuGet Packages dialog:
    • Right-click the project in Solution Explorer > Manage NuGet Packages
    • Set the Package source to "nuget.org"
    • Enter "Swashbuckle.AspNetCore" in the search box
    • Select the "Swashbuckle.AspNetCore" package from the Browse tab and click Install


  • Add the Swagger generator to the services collection in the Startup.ConfigureServices method.
  • Import the following namespace to use the Info class:

  • In the Startup.Configure method, enable the middleware for serving the generated JSON document and the Swagger UI
  • Build and run the solution. Browse to Swagger URL now, which will be http://localhost:port/swagger. e.g. http://localhost:60212/swagger/




  • You can dig into an api definition by clicking on it and try out by providing parameters required. e.g. in example below we can see what will be provided in POST call to create dealer.