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

No way to specify Azure Data Warehouse Gen 2 #5196

Closed
ghost opened this issue Dec 17, 2019 · 6 comments · Fixed by #7527
Closed

No way to specify Azure Data Warehouse Gen 2 #5196

ghost opened this issue Dec 17, 2019 · 6 comments · Fixed by #7527

Comments

@ghost
Copy link

ghost commented Dec 17, 2019

This issue was originally opened by @Ethan-Arrowood as hashicorp/terraform#23690. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.12.16
+ provider.azurerm v1.38.0

Terraform Configuration Files

resource "azurerm_sql_server" "sql_server" {
  name = var.sql_server_name
  resource_group_name = azurerm_resource_group.rg.name
  location = azurerm_resource_group.rg.location
  version = "12.0"
  administrator_login = "etarrowo"
  administrator_login_password = "abcdef"

  tags = {
    environment = var.environment
  }
}

resource "azurerm_sql_database" "sql_dw" {
  name = var.sql_dw_name
  resource_group_name = azurerm_resource_group.rg.name
  location = azurerm_resource_group.rg.location
  server_name = azurerm_sql_server.sql_server.name
  edition = "DataWarehouse"
  requested_service_objective_name = "DW100"

  tags = {
    environment = var.environment
  }
}

Crash Output

azurerm_sql_database.sql_dw: Creating...

Error: Error issuing create/update request for SQL Database "etar-sql-dw-1" (Resource Group "learn-terraform", Server "etar-sql-server-1"): sql.DatabasesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="Failed" Message="The async operation failed." InnerError={"unmarshalError":"json: cannot unmarshal array into Go struct field serviceError2.details of type map[string]interface {}"} AdditionalInfo=[{"code":"45122","details":[{"code":"45122","message":"'Gen1 Data Warehouse has been deprecated in this region. Please leverage Gen2 Data Warehouse.'","severity":"16","target":null}],"innererror":[],"message":"'Gen1 Data Warehouse has been deprecated in this region. Please leverage Gen2 Data Warehouse.'","target":null}]

  on sql-dw-deployment.tf line 29, in resource "azurerm_sql_database" "sql_dw":
  29: resource "azurerm_sql_database" "sql_dw" {

Expected Behavior

An Azure SQL Server and DataWarehouse is created

Actual Behavior

SQL Server is created successfully, but SQL DataWarehouse fails on invalid generation type

Steps to Reproduce

  1. terraform init
  2. terraform plan -var 'location=east us' -var 'rg_name=learn-terraform' -var 'sql_server_name=etar-sql-server-1' -var 'sql_dw_name=etar-sql-dw-1' -var 'environment=testing' -out out-1.tfplan
  3. terraform apply out-1.tfplan

Additional Context

This is being run directly from Azure Cloud Shell on a resource group with Terraform installed.

References

@mehdi-kimakhe-amido
Copy link

mehdi-kimakhe-amido commented Dec 18, 2019

I think you didn't use the correct "requested service objective name" (DW100).
Can you try with this:

requested_service_objective_name = "DW100c"

Maybe the error code should be changed.

@Ethan-Arrowood
Copy link

This was it! -- Can I ask we document this more clearly? I'm happy to do the work just need to know where to contribute.

@katbyte katbyte added service/mssql Microsoft SQL Server documentation labels Dec 31, 2019
@katbyte
Copy link
Collaborator

katbyte commented Dec 31, 2019

@Ethan-Arrowood, it would probably be best to add it to the SQL resource documentation

@neil-yechenwei
Copy link
Contributor

Hopes this PR would be helpful.

@tombuildsstuff tombuildsstuff added this to the v2.17.0 milestone Jul 1, 2020
@ghost
Copy link
Author

ghost commented Jul 3, 2020

This has been released in version 2.17.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.17.0"
}
# ... other configuration ...

@ghost
Copy link
Author

ghost commented Aug 1, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants