Skip to content

Commit c60e771

Browse files
authored
Merge pull request #205184 from seesharprun/free-tier-script
Cosmos DB | Implement free tier script
2 parents 2c8a9b0 + 900bb5b commit c60e771

File tree

4 files changed

+125
-64
lines changed

4 files changed

+125
-64
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -177,32 +177,34 @@
177177
href: ./resource-graph-samples.md
178178
- name: Azure CLI
179179
items:
180-
- name: Overview common API samples
181-
href: common-cli-samples.md
182-
- name: Add or fail over regions
183-
href: scripts/cli/common/regions.md
184-
- name: Perform account key operations
185-
href: scripts/cli/common/keys.md
186-
- name: Secure with IP firewall
187-
href: scripts/cli/common/ipfirewall.md
188-
- name: Secure new account with service endpoints
189-
href: scripts/cli/common/service-endpoints.md
190-
- name: Secure existing account with service endpoints
191-
href: scripts/cli/common/service-endpoints-ignore-missing-vnet.md
180+
- name: Overview common API samples
181+
href: common-cli-samples.md
182+
- name: Add or fail over regions
183+
href: scripts/cli/common/regions.md
184+
- name: Perform account key operations
185+
href: scripts/cli/common/keys.md
186+
- name: Secure with IP firewall
187+
href: scripts/cli/common/ipfirewall.md
188+
- name: Secure new account with service endpoints
189+
href: scripts/cli/common/service-endpoints.md
190+
- name: Secure existing account with service endpoints
191+
href: scripts/cli/common/service-endpoints-ignore-missing-vnet.md
192+
- name: Find existing free-tier accounts
193+
href: scripts/cli/common/free-tier.md
192194
- name: Azure PowerShell
193195
items:
194-
- name: Overview common API samples
195-
href: common-powershell-samples.md
196-
- name: Account keys or connection strings
197-
href: scripts/powershell/common/keys-connection-strings.md
198-
- name: Change failover priority or trigger failover
199-
href: scripts/powershell/common/failover-priority-update.md
200-
- name: Create an account with IP Firewall
201-
href: scripts/powershell/common/firewall-create.md
202-
- name: Update account
203-
href: scripts/powershell/common/account-update.md
204-
- name: Update an account's regions
205-
href: scripts/powershell/common/update-region.md
196+
- name: Overview common API samples
197+
href: common-powershell-samples.md
198+
- name: Account keys or connection strings
199+
href: scripts/powershell/common/keys-connection-strings.md
200+
- name: Change failover priority or trigger failover
201+
href: scripts/powershell/common/failover-priority-update.md
202+
- name: Create an account with IP Firewall
203+
href: scripts/powershell/common/firewall-create.md
204+
- name: Update account
205+
href: scripts/powershell/common/account-update.md
206+
- name: Update an account's regions
207+
href: scripts/powershell/common/update-region.md
206208
- name: How to
207209
items:
208210
- name: Free tier

articles/cosmos-db/free-tier.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
11
---
22
title: Azure Cosmos DB free tier
33
description: Use Azure Cosmos DB free tier to get started, develop, test your applications. With free tier, you'll get the first 1000 RU/s and 25 GB of storage in the account for free.
4-
author: ThomasWeiss
5-
ms.author: thweiss
4+
author: seesharprun
5+
ms.author: sidandrews
66
ms.service: cosmos-db
77
ms.topic: how-to
8-
ms.date: 03/29/2022
8+
ms.date: 07/08/2022
99
---
1010

11-
# Azure Cosmos DB free tier
11+
# Azure Cosmos DB free tier
12+
1213
[!INCLUDE[appliesto-all-apis](includes/appliesto-all-apis.md)]
1314

1415
Azure Cosmos DB free tier makes it easy to get started, develop, test your applications, or even run small production workloads for free. When free tier is enabled on an account, you'll get the first 1000 RU/s and 25 GB of storage in the account for free. The throughput and storage consumed beyond these limits are billed at regular price. Free tier is available for all API accounts with provisioned throughput, autoscale throughput, single, or multiple write regions.
1516

1617
Free tier lasts indefinitely for the lifetime of the account and it comes with all the [benefits and features](introduction.md#key-benefits) of a regular Azure Cosmos DB account. These benefits include unlimited storage and throughput (RU/s), SLAs, high availability, turnkey global distribution in all Azure regions, and more.
1718

18-
You can have up to one free tier Azure Cosmos DB account per an Azure subscription and you must opt-in when creating the account. If you do not see the option to apply the free tier discount, this means another account in the subscription has already been enabled with free tier. If you create an account with free tier and then delete it, you can apply free tier for a new account. When creating a new account, it’s recommended to enable the free tier discount if it’s available.
19+
You can have up to one free tier Azure Cosmos DB account per an Azure subscription and you must opt in when creating the account. If you don't see the option to apply the free tier discount, another account in the subscription has already been enabled with free tier. If you create an account with free tier and then delete it, you can apply free tier for a new account. When creating a new account, it’s recommended to enable the free tier discount if it’s available.
1920

2021
> [!NOTE]
2122
> Free tier is currently not available for serverless accounts.
2223
2324
## Free tier with shared throughput database
2425

25-
In shared throughput model, when you provision throughput on a database, the throughput is shared across all the containers in the database. When using the free tier, you can provision a shared database with up to 1000 RU/s for free. All containers in the database will share the throughput.
26+
In shared throughput model, when you provision throughput on a database, the throughput is shared across all the containers in the database. When using the free tier, you can provision a shared database with up to 1000 RU/s for free. All containers in the database will share the throughput.
2627

27-
Just like the regular account, in the free tier account, a shared throughput database can have a max of 25 containers.
28-
Any additional databases with shared throughput or containers with dedicated throughput beyond 1000 RU/s are billed at the regular pricing.
28+
Just like the regular account, in the free tier account, a shared throughput database can have a max of 25 containers.
29+
Any other databases with shared throughput or containers with dedicated throughput beyond 1000 RU/s are billed at the regular pricing.
2930

3031
## Free tier with Azure discount
3132

32-
The Azure Cosmos DB free tier is compatible with the [Azure free account](optimize-dev-test.md#azure-free-account). To opt-in, create an Azure Cosmos DB free tier account in your Azure free account subscription. For the first 12 months, you will get a combined discount of 1400 RU/s (1000 RU/s from Azure Cosmos DB free tier and 400 RU/s from Azure free account) and 50 GB of storage (25 GB from Azure Cosmos DB free tier and 25 GB from Azure free account). After the 12 months expires, you will continue to get 1000 RU/s and 25 GB from the Azure Cosmos DB free tier, for the lifetime of the Azure Cosmos DB account. For an example of how the charges are stacked, see [Billing examples with free tier accounts](understand-your-bill.md#azure-free-tier).
33+
The Azure Cosmos DB free tier is compatible with the [Azure free account](optimize-dev-test.md#azure-free-account). To opt in, create an Azure Cosmos DB free tier account in your Azure free account subscription. For the first 12 months, you'll get a combined discount of 1400 RU/s (1000 RU/s from Azure Cosmos DB free tier and 400 RU/s from Azure free account) and 50 GB of storage (25 GB from Azure Cosmos DB free tier and 25 GB from Azure free account). After the 12 months expire, you'll continue to get 1000 RU/s and 25 GB from the Azure Cosmos DB free tier, for the lifetime of the Azure Cosmos DB account. For an example of how the charges are stacked, see [Billing examples with free tier accounts](understand-your-bill.md#azure-free-tier).
3334

3435
> [!NOTE]
3536
> Azure Cosmos DB free tier is different from the Azure free account. The Azure free account offers Azure credits and resources for free for a limited time. When using Azure Cosmos DB as a part of this free account, you get 25-GB storage and 400 RU/s of provisioned throughput for 12 months.
3637
3738
## Best practices to keep your account free
3839

39-
When using Azure Cosmos DB free tier, to keep your account completely free of charge, your account should not have any additional RU/s or storage consumption other than the one offered by the free tier.
40+
To keep your account free of charge, your account shouldn't have any more RU/s or storage consumption other than the one offered by the Azure Cosmos DB free tier.
4041

4142
For example, the following are some options that don’t result in any monthly charge:
4243

4344
* One database with a max of 1000 RU/s provisioned throughput.
4445
* Two containers one with a max of 400 RU/s and other with a max of 600 RU/s provisioned throughput.
45-
* Account with 2 regions with a single region that has one container with a max of 500 RU/s provisioned throughput.
46+
* Account with two regions with a single region that has one container with a max of 500 RU/s provisioned throughput.
4647

4748
## Create an account with free tier
4849

@@ -54,7 +55,7 @@ When creating the account using the Azure portal, set the **Apply Free Tier Disc
5455

5556
### ARM template
5657

57-
To create a free tier account by using an ARM template, set the property `"enableFreeTier": true`. For the complete template, see deploy an [ARM template with free tier](manage-with-templates.md#free-tier) example.
58+
To create a free tier account by using an ARM template, set the property `"enableFreeTier": true`. For the complete template, see [deploy an ARM template with free tier](manage-with-templates.md#free-tier) example.
5859

5960
### CLI
6061

@@ -82,6 +83,10 @@ New-AzCosmosDBAccount -ResourceGroupName "MyResourcegroup" `
8283
-DefaultConsistencyLevel "Session" `
8384
```
8485

86+
### Unable to create a free-tier account
87+
88+
If the option to create a free-tier account is disabled or if you receive an error saying you can't create a free-tier account, another account in the subscription has already been enabled with free tier. To find the existing free-tier account and the resource group it is in, use this Azure CLI script, [Find Existing Free-Tier Account](scripts/cli/common/free-tier.md).
89+
8590
## Next steps
8691

8792
After you create a free tier account, you can start building apps with Azure Cosmos DB with the following articles:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Find an existing Azure Cosmos DB free-tier account in a subscription
3+
description: Find an existing Azure Cosmos DB free-tier account in a subscription
4+
author: seesharprun
5+
ms.author: sidandrews
6+
ms.reviewer: mjbrown
7+
ms.service: cosmos-db
8+
ms.topic: sample
9+
ms.date: 07/08/2022
10+
---
11+
12+
# Find an existing Azure Cosmos DB free-tier account in a subscription using Azure CLI
13+
14+
[!INCLUDE[appliesto-all-apis](../../../includes/appliesto-all-apis.md)]
15+
16+
The script in this article demonstrates how to locate an Azure Cosmos DB free-tier account within a subscription.
17+
18+
Each Azure subscription can have up to one Azure Cosmos DB free-tier account. If you're trying to create a free-tier account, the option may be disabled in the Azure portal, or you get an error when attempting to create a free-tier account. If either of these issues occur, use this script to locate the name of the existing free-tier account, and the resource group it belongs to.
19+
20+
[!INCLUDE [quickstarts-free-trial-note](../../../../../includes/quickstarts-free-trial-note.md)]
21+
22+
[!INCLUDE [azure-cli-prepare-your-environment.md](../../../../../includes/azure-cli-prepare-your-environment.md)]
23+
24+
- This article requires version 2.9.1 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
25+
26+
## Sample script
27+
28+
[!INCLUDE [cli-launch-cloud-shell-sign-in.md](../../../../../includes/cli-launch-cloud-shell-sign-in.md)]
29+
30+
### Run the script
31+
32+
:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/common/find-free-tier-account.sh" id="FullScript":::
33+
34+
## Sample reference
35+
36+
This script uses the following commands. Each command in the table links to command specific documentation.
37+
38+
| Command | Notes |
39+
|---|---|
40+
| [az group list](/cli/azure/group#az-group-list) | Lists all resource groups in an Azure subscription. |
41+
| [az cosmosdb list](/cli/azure/cosmosdb#az-cosmosdb-list) | Lists all Azure Cosmos DB account in a resource group. |
42+
43+
## Next steps
44+
45+
For more information on the Azure Cosmos DB CLI, see [Azure Cosmos DB CLI documentation](/cli/azure/cosmosdb).
46+
47+
For Azure CLI samples for specific APIs, see:
48+
49+
- [CLI Samples for Cassandra](../../../cassandra/cli-samples.md)
50+
- [CLI Samples for Gremlin](../../../graph/cli-samples.md)
51+
- [CLI Samples for MongoDB API](../../../mongodb/cli-samples.md)
52+
- [CLI Samples for SQL](../../../sql/cli-samples.md)
53+
- [CLI Samples for Table](../../../table/cli-samples.md)

0 commit comments

Comments
 (0)