0

Is it possible to apply the free offer via Terraform? So far I can only apply it when I manually create the database and click on the "Apply offer" button.

enter image description here

I would expect that this is possible, since this offer has been around for 1-2 years, but I have not found anything about it.

1
  • The “Apply offer” feature is a UI-specific workflow.Microsoft has not published an API or flag to enable the offer programmatically (via ARM, Bicep, or REST either). You can still deploy a serverless database via Terraform, and then manually apply the offer once from the Azure Portal Commented Apr 16 at 11:31

2 Answers 2

0

Apply Azure SQL database free offer via Terraform

AFAIK, it's not possible to apply the Azure SQL free offer via Terraform. The Apply offer option is currently only available through the Azure Portal UI, and there’s no exposed parameter or API in ARM, Bicep, or Terraform to enable it programmatically.

You can, however, deploy a serverless Azure SQL Database using Terraform and then manually apply the offer once through the portal. Once applied, the offer remains active for the lifetime of the subscription (within usage limits), and you can continue to manage the database using Terraform.

Sign up to request clarification or add additional context in comments.

1 Comment

I wanted indeed manually apply the offer after I have created the serverless DB, but I don't have the offer anymore. Location: France Central Pricing tier: General Purpose, Gen5, Vcore 1
0

I tried editing the SKU of a azurerm_mssql_database resource to "Free" and the terraform validation allows this value while throwing errors for any fictional values.

resource "azurerm_mssql_database" "this" {
  name        = "test-db"
  sku_name    = "Free"
  server_id   = azurerm_mssql_server.this.id //defined outside the code snippet
  collation   = "SQL_Latin1_General_CP1_CI_AS"
  max_size_gb = 2
}

I'm not sure if this is equivalent to applying the offer, but I don't know of any other free tier.

So maybe give it a try!

1 Comment

While this works, it is different from applying the free offer from the Portal. Within the Free tier, you will have 5 DTUs and 32 MB of shared storage. And this free DB trial will end in 365 days, after which it will be upgraded to Basic. This is in contrast to the free offer from Portal which will give you 32 GB of storage and 100,000 vCore seconds every month.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.