Home > Software design >  Can I determine if a subscription is eligible for a "free tier" Cosmos DB account in an AR
Can I determine if a subscription is eligible for a "free tier" Cosmos DB account in an AR

Time:07-02

I'm writing an ARM template that will be executed as part of an installer for an app that will be distributed to some customers. The app depends on Cosmos DB. It would be preferable for the customer for the Cosmos DB account we create to be opted-in to the free tier.

As per the docs:

You can have up to one free tier Azure Cosmos DB account per an Azure subscription

For most customers, the one we provision with our ARM template will be their first and only Cosmos DB account. In 90% of cases, therefore, we can probably enable the free tier with something like this:

"resources": [
    {
        "type": "Microsoft.DocumentDB/databaseAccounts",
        "apiVersion": "2020-03-01",
        // ...
        "properties": {
            "enableFreeTier": true,

However, some customers (perhaps larger customers, or those more adventurous with tech) will already have a Cosmos DB account and will likely have opted it in to the free tier.

Is there any way in an ARM template to determine whether the current subscription is still eligible for a free tier Cosmos DB account?

CodePudding user response:

You can parameterize the enableFreeTier property and specify it at deployment time. Default it to true if you like. How that parameter is ascertained will depend on your deployment process.

Determining the value within the template won't be possible as @NotFound said.

  • Related