Azure SQL Database pricing api

Vikas Neekhra 6 Reputation points
2021-12-08T06:37:36.423+00:00

I am looking for any pricing api which can give us the pricing of a given database family.

For ex: I have the currentSKU details as below, so if I pass the family and tier of a database then it will return all the databases with price of that family and tier.

 "currentSku": {
        "name": "GP_Gen5",
        "tier": "GeneralPurpose",
        "family": "Gen5",
        "capacity": 2
  }

So in above example, it should return all the GeneralPurpose Gen5 Azure SQL databases with all vCore capacity.. 2, 4, and so on... with pricing.

Azure SQL Database
Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
279 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,571 Reputation points
    2021-12-08T09:03:07.66+00:00

    Hi @Vikas Neekhra , welcome to Microsoft Q&A forum.

    Using REST APIs, I think we don't have the way to list the databases using SKU as filter but we can use PowerShell commandlet like below to get the list of databases by providing the filters:

    Get-AzSqlDatabase -ServerName <Name of Server> -ResourceGroupName <Name of Resource groups> | Where-Object {$_.SkuName -like 'GP_Gen5' -and $_.Edition -like 'GeneralPurpose'}    
    

    Please let me know if this is helpful or else we can discuss further.