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

Support for Azure SQL Database Geo-Zone-Redundant Backup Storage #19542

Closed
1 task done
AErmie opened this issue Dec 2, 2022 · 9 comments
Closed
1 task done

Support for Azure SQL Database Geo-Zone-Redundant Backup Storage #19542

AErmie opened this issue Dec 2, 2022 · 9 comments
Labels
enhancement sdk/requires-newer-api-version This requires upgrading the version of the API being used service/sql

Comments

@AErmie
Copy link

AErmie commented Dec 2, 2022

Is there an existing issue for this?

  • I have searched the existing issues

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

Description

If you want to deploy an Azure SQL Database using Terraform, not all backup storage redundancy options are supported.

The options that are supported in the Azure Portal, include:

  • Locally-Redundant backup storage
  • Zone-Redundant backup storage
  • Geo-Redundant backup storage
  • Geo-Zone-Redundant backup storage

Azure-Portal-Backup-Storage-Redundancy

When you define the code block in Terraform for the azurerm_mssql_database resource, there is a property for storage_account_type (shown in the screenshot below).

Terraform-Code

However, the only supported types are geo, local, or zone, per the error shown by Terraform. Geo-Zone is not a supported account type, although it is an option in the portal.

Terraform-Plan-Error

Even though the azurerm_storage_account resource itself has a property for account_replication_type, which has valid options of: LRS, GRS, RAGRS, ZRS, GZRS and RAGZRS, you cannot use GZRS as a storage_account_type in the azurerm_mssql_database resource either.

It would be appreciated if the Azure Terraform Provider could be updated to support all properties and configurations for this Azure service.

Other Details

Terraform version: 0.15.5
AzureRM Provider version: 3.34.0

New or Affected Resource(s)/Data Source(s)

azurerm_mssql_database

Potential Terraform Configuration

resource "azurerm_mssql_database" "this" {
  storage_account_type    = "Geo-Zone"
}

References

@mybayern1974 mybayern1974 added enhancement sdk/requires-newer-api-version This requires upgrading the version of the API being used service/sql labels Dec 5, 2022
@gkello
Copy link

gkello commented Apr 27, 2023

That missing option is currently blocking me to provision HyperScale database with geo-redundant storage and zone_redundant = true: And it is not possible to adjust backup storage type after database creation for HyperScale tier.

resource azurerm_mssql_database "hyperscale" {
  name                  = "example-hyperscaledb"
  server_id             = azurerm_mssql_server.example.id
  sku_name              = "HS_Gen5_2"

  read_replica_count    = 1
  zone_redundant        = true
}

results with

Error: waiting for create/update of Database: (Name "example-hyperscaledb" / Server Name "example-mssqlserver" / Resource Group "example-database-rg"): Code="ProvisioningDisabled" Message="Provisioning of zone redundant Hyperscale database with geo backup redundancy is not supported. Zone redundant Hyperscale databases must use either zone or geo zone backup redundancy."
with azurerm_mssql_database.hyperscale
on hyperscaledb.tf line 24, in resource "azurerm_mssql_database" "hyperscale":

@aparker-cityworks
Copy link

This affects resource azurerm_mssql_managed_instance in the same way.

@quaintance
Copy link

does anyone have a workaround for this in the meantime? As far as I can tell, I cannot ignore this configuration in lifecycle management, we just can't manage anything about these DBs in Terraform.

@MichalSino
Copy link

Any changes about this ?

@MichalSino
Copy link

I found that API 23-02-01-preview supports: Local, Zone, Geo and GeoZone, so may be the provider shloud be updated to this Api version.

@richsage
Copy link
Contributor

Looking at the code it looks like it already uses API 2023-02-01-preview, and there is a GeoZone storage option available - I haven't tested it but maybe this is already solved?

@MichalSino
Copy link

I confirmed it. It works now. :)

@katbyte
Copy link
Collaborator

katbyte commented Feb 13, 2024

this seems to have been fixed by #23721 - as such i am going to close it out!

@katbyte katbyte closed this as completed Feb 13, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement sdk/requires-newer-api-version This requires upgrading the version of the API being used service/sql
Projects
None yet
Development

No branches or pull requests

8 participants