Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_mssql_database with Free or Stretch SKU doesn't support retention policies #13387

Open
thllxb opened this issue Sep 16, 2021 · 0 comments

Comments

@thllxb
Copy link
Contributor

thllxb commented Sep 16, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v1.0.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/azurerm v2.76.0

Affected Resource(s)

  • azurerm_mssql_database

Terraform Configuration Files

resource "azurerm_mssql_database" "free" {
  name      = "free"
  server_id = azurerm_mssql_server.main.id
  sku_name  = "free"
}

resource "azurerm_mssql_database" "stretch" {
  name      = "stretch"
  server_id = azurerm_mssql_server.main.id
  sku_name  = "DS100"
}

Debug Output

https://gist.github.com/thllxb/3e2c1655e16221dbd70c97923ec5d44c

Panic Output

│ Error: retrieving Long Term Policies for Database "free" (Sql Server "xterra-114-mssql-1" ;Resource Group "xterra-114-mssql"): sql.BackupLongTermRetentionPoliciesClient#Get: Failure responding to r
equest: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LongTermRetentionPolicyNotSupported" Message="Long Term Retention is not supported : Not supporte
d for database with Free edition."
│
│   with azurerm_mssql_database.free,
│   on mssql.tf line 15, in resource "azurerm_mssql_database" "free":
│   15: resource "azurerm_mssql_database" "free" {
│
╵
╷
│ Error: retrieving Long Term Policies for Database "stretch" (Sql Server "xterra-114-mssql-1" ;Resource Group "xterra-114-mssql"): sql.BackupLongTermRetentionPoliciesClient#Get: Failure responding t
o request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LongTermRetentionPolicyNotSupported" Message="Long Term Retention is not supported : Not suppo
rted for database with Stretch edition."
│
│   with azurerm_mssql_database.stretch,
│   on mssql.tf line 21, in resource "azurerm_mssql_database" "stretch":
│   21: resource "azurerm_mssql_database" "stretch" {
│
╵

Expected Behaviour

Databases created successfully and terraform exits without error

Actual Behaviour

Databases created successfully but terraform exits with an error

Steps to Reproduce

  1. terraform apply

Important Factoids

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants