hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.48k stars 4.56k forks source link

Issue related to closed issue #4350: Can't create premium storage share #7508

Closed jmspradlin closed 3 years ago

jmspradlin commented 4 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform 0.12.28 azurerm 2.14.0

Affected Resource(s)

Terraform Configuration Files


resource "azurerm_storage_account" "storage" {
    name                     = "${replace(var.app_name, "-", "")}config"
    resource_group_name      = data.azurerm_resource_group.this.name
    location                 = data.azurerm_resource_group.this.location
    account_tier             = "Premium"
    account_replication_type = "LRS"
}

resource "azurerm_storage_share" "this" {
  name                 = "default"
  storage_account_name = azurerm_storage_account.storage.name
  quota                = 50
}

Debug Output

Panic Output

Expected Behavior

Create a storage share with premium azure file. The configuration works if account_tier = Standard

Actual Behavior

It failed with error:

Error: Error creating Share "default" (Account "null" / Resource Group "null"): shares.Client#Create: Failure sending request: StatusCode=0 -- Original Error: Put https://null.file.core.windows.net/null?restype=share: dial tcp: lookup nancycas4.file.core.windows.net: no such host

on main.tf line 14, in resource "azurerm_storage_share" "this": 14: resource "azurerm_storage_share" "this" {

Steps to Reproduce

  1. terraform apply

Important Factoids

Long time, first time, so please forgive any contribution guidelines missed.

I saw this issue previously opened and apparently unresolved in the previous issues, and wanted to provide some findings. This does not appear to be a Terraform issue, but an Azure Premium issue with fileshares.

What storage tiers are supported in Azure Files? Azure Files supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts.

Azure File Storage FAQ

Correcting this issue is a matter of adding to the storage account creation the account_kind reference of FileStorage:

account_kind = "FileStorage"

The error seen above is the result of an incorrect URL for the type of storage created (since the default is StorageV2 and Premium StorageV2 does not have file storage available and the URL query returns a no such host response).

References

jmspradlin commented 4 years ago

Long time, first time, so please forgive any contribution guidelines missed.

I saw this issue previously opened and apparently unresolved in the previous issues, and wanted to provide some findings. This does not appear to be a Terraform issue, but an Azure Premium storage issue with fileshares.

What storage tiers are supported in Azure Files? Azure Files supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts.

Azure File Storage FAQ

Correcting this issue is a matter of adding to the storage account creation the account_kind reference of FileStorage:

account_kind = "FileStorage"

The error seen above is the result of an incorrect URL for the type of storage created (since the default is StorageV2 and Premium StorageV2 does not have file storage available and the URL query returns a no such host response).

neil-yechenwei commented 3 years ago

Thanks for opening this issue. I assume you're right. So I submit a PR to update doc.

ghost commented 3 years ago

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!