|
| 1 | +--- |
| 2 | +title: Plan and manage costs for Azure SQL Database |
| 3 | +description: Learn how to plan for and manage costs for Azure SQL Database by using cost analysis in the Azure portal. |
| 4 | +author: stevestein |
| 5 | +ms.author: sstein |
| 6 | +ms.custom: subject-cost-optimization |
| 7 | +ms.service: sql-database |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 01/15/2021 |
| 10 | +--- |
| 11 | + |
| 12 | + |
| 13 | +# Plan and manage costs for Azure SQL Database |
| 14 | + |
| 15 | +This article describes how you plan for and manage costs for Azure SQL Database. First, you use the Azure pricing calculator to add Azure resources, and review the estimated costs. After you've started using Azure SQL Database resources, use Cost Management features to set budgets and monitor costs. You can also review forecasted costs and identify spending trends to identify areas where you might want to act. Costs for Azure SQL Database are only a portion of the monthly costs in your Azure bill. Although this article explains how to plan for and manage costs for Azure SQL Database, you're billed for all Azure services and resources used in your Azure subscription, including any third-party services. |
| 16 | + |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +Cost analysis supports most Azure account types, but not all of them. To view the full list of supported account types, see [Understand Cost Management data](../../cost-management-billing/costs/understand-cost-mgt-data.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). To view cost data, you need at least read access for an Azure account. |
| 21 | + |
| 22 | +For information about assigning access to Azure Cost Management data, see [Assign access to data](../../cost-management/assign-access-acm-data.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). |
| 23 | + |
| 24 | + |
| 25 | +## SQL Database initial cost considerations |
| 26 | + |
| 27 | +When working with Azure SQL Database, there are several cost-saving features to consider: |
| 28 | + |
| 29 | + |
| 30 | +### vCore or DTU purchasing models |
| 31 | + |
| 32 | +Azure SQL Database supports two purchasing models: vCore and DTU. The way you get charged varies between the purchasing models so it's important to understand the model that works best for your workload when planning and considering costs. For information about vCore and DTU purchasing models, see [Choose between the vCore and DTU purchasing models](purchasing-models.md). |
| 33 | + |
| 34 | + |
| 35 | +### Provisioned or serverless |
| 36 | + |
| 37 | +In the vCore purchasing model, Azure SQL Database also supports two types of compute tiers: provisioned throughput and serverless. The way you get charged for each compute tier varies so it's important to understand what works best for your workload when planning and considering costs. For details, see [vCore model overview - compute tiers](service-tiers-vcore.md#compute-tiers). |
| 38 | + |
| 39 | +In the provisioned compute tier of the vCore-based purchasing model, you can exchange your existing licenses for discounted rates. For details, see [Azure Hybrid Benefit (AHB)](../azure-hybrid-benefit.md). |
| 40 | + |
| 41 | +### Elastic pools |
| 42 | + |
| 43 | +For environments with multiple databases that have varying and unpredictable usage demands, elastic pools can provide cost savings compared to provisioning the same amount of single databases. For details, see [Elastic pools](elastic-pool-overview.md). |
| 44 | + |
| 45 | +## Estimate Azure SQL Database costs |
| 46 | + |
| 47 | +Use the [Azure pricing calculator](https://azure.microsoft.com/pricing/calculator/) to estimate costs for different Azure SQL Database configurations. The information and pricing in the following image are for example purposes only: |
| 48 | + |
| 49 | +:::image type="content" source="media/cost-management/pricing-calc.png" alt-text="Azure SQL Database pricing calculator example"::: |
| 50 | + |
| 51 | +You can also estimate how different Retention Policy options affect cost. The information and pricing in the following image are for example purposes only: |
| 52 | + |
| 53 | +:::image type="content" source="media/cost-management/backup-storage.png" alt-text="Azure SQL Database pricing calculator example for storage"::: |
| 54 | + |
| 55 | + |
| 56 | +## Understand the full billing model for Azure SQL Database |
| 57 | + |
| 58 | +Azure SQL Database runs on Azure infrastructure that accrues costs along with Azure SQL Database when you deploy the new resource. It's important to understand that additional infrastructure might accrue cost. You need to manage that cost when you make changes to deployed resources. |
| 59 | + |
| 60 | + |
| 61 | +Azure SQL Database (with the exception of serverless) is billed on a predictable, hourly rate. If the SQL database is active for less than one hour, you are billed for each hour the database exists using the highest service tier selected, provisioned storage and IO that applied during that hour, regardless of usage or whether the database was active for less than an hour. |
| 62 | + |
| 63 | + |
| 64 | +### Using Monetary Credit with Azure SQL Database |
| 65 | + |
| 66 | +You can pay for Azure SQL Database charges with your EA monetary commitment credit. However, you can't use EA monetary commitment credit to pay for charges for third party products and services including those from the Azure Marketplace. |
| 67 | + |
| 68 | +## Review estimated costs in the Azure portal |
| 69 | + |
| 70 | +As you go through the process of creating an Azure SQL Database, you can see the estimated costs during configuration of the compute tier. |
| 71 | + |
| 72 | +To access this screen, select **Configure database** on the **Basics** tab of the **Create SQL Database** page. The information and pricing in the following image are for example purposes only: |
| 73 | + |
| 74 | + :::image type="content" source="media/cost-management/cost-estimate.png" alt-text="Example showing cost estimate in the Azure portal"::: |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +If your Azure subscription has a spending limit, Azure prevents you from spending over your credit amount. As you create and use Azure resources, your credits are used. When you reach your credit limit, the resources that you deployed are disabled for the rest of that billing period. You can't change your credit limit, but you can remove it. For more information about spending limits, see [Azure spending limit](https://docs.microsoft.com/azure/billing/billing-spending-limit). |
| 79 | + |
| 80 | +## Monitor costs |
| 81 | + |
| 82 | +As you start using Azure SQL Database, you can see the estimated costs in the portal. Use the following steps to review the cost estimate: |
| 83 | + |
| 84 | +1. Sign into the Azure portal and navigate to your Azure SQL database's resource group. You can locate the resource group by navigating to your database and select **Resource group** in the **Overview** section. |
| 85 | +1. In the menu, select **Cost analysis**. |
| 86 | +1. View **Accumulated costs** and set the chart at the bottom to **Service name**. This chart shows an estimate of your current SQL Database costs. To narrow costs for the entire page to Azure SQL Database, select **Add filter** and then, select **Azure SQL Database**. The information and pricing in the following image are for example purposes only: |
| 87 | + |
| 88 | + :::image type="content" source="media/cost-management/cost-analysis.png" alt-text="Example showing accumulated costs in the Azure portal"::: |
| 89 | + |
| 90 | +From here, you can explore costs on your own. For more and information about the different cost analysis settings, see [Start analyzing costs](../../cost-management/cost-mgt-alerts-monitor-usage-spending.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). |
| 91 | + |
| 92 | +## Create budgets |
| 93 | + |
| 94 | +<!-- Note to Azure service writer: Modify the following as needed for your service. --> |
| 95 | + |
| 96 | +You can create [budgets](../../cost-management/tutorial-acm-create-budgets.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn) to manage costs and create [alerts](../../cost-management/cost-mgt-alerts-monitor-usage-spending.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn) that automatically notify stakeholders of spending anomalies and overspending risks. Alerts are based on spending compared to budget and cost thresholds. Budgets and alerts are created for Azure subscriptions and resource groups, so they're useful as part of an overall cost monitoring strategy. |
| 97 | + |
| 98 | +Budgets can be created with filters for specific resources or services in Azure if you want more granularity present in your monitoring. Filters help ensure that you don't accidentally create new resources that cost you additional money. For more about the filter options when you when create a budget, see [Group and filter options](../../cost-management-billing/costs/group-filter.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). |
| 99 | + |
| 100 | +## Export cost data |
| 101 | + |
| 102 | +You can also [export your cost data](../../cost-management-billing/costs/tutorial-export-acm-data.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn) to a storage account. This is helpful when you need or others to do additional data analysis for costs. For example, a finance teams can analyze the data using Excel or Power BI. You can export your costs on a daily, weekly, or monthly schedule and set a custom date range. Exporting cost data is the recommended way to retrieve cost datasets. |
| 103 | + |
| 104 | + |
| 105 | +## Other ways to manage and reduce costs for Azure SQL Database |
| 106 | + |
| 107 | +Azure SQL Database also enables you to scale resources up or down to control costs based on your application needs. For details, see [Dynamically scale database resources](scale-resources.md). |
| 108 | + |
| 109 | +Save money by committing to a reservation for compute resources for one to three years. For details, see [Save costs for resources with reserved capacity](reserved-capacity-overview.md). |
| 110 | + |
| 111 | + |
| 112 | +## Next steps |
| 113 | + |
| 114 | +- Learn [how to optimize your cloud investment with Azure Cost Management](../../cost-management-billing/costs/cost-mgt-best-practices.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). |
| 115 | +- Learn more about managing costs with [cost analysis](../../cost-management-billing/costs/quick-acm-cost-analysis.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). |
| 116 | +- Learn about how to [prevent unexpected costs](../../cost-management-billing/manage/getting-started.md?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn). |
| 117 | +- Take the [Cost Management](https://docs.microsoft.com/learn/paths/control-spending-manage-bills?WT.mc_id=costmanagementcontent_docsacmhorizontal_-inproduct-learn) guided learning course. |
0 commit comments