terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

Terraform not recognizing BlockBlob Storage accounts

Open ChristinaLanaski opened this issue 11 months ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: 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 and review the contribution guide to help.

Terraform Version

3.227.0

AzureRM Provider Version

3.93.0

Affected Resource(s)/Data Source(s)

azurerm_storage_account

Terraform Configuration Files

### Terraform Version


The version we want to use is 3.93, which is the version that is giving us this error. When switching back to the version we originally had, v3.47.0, it worked fine.



### Terraform Configuration Files

```terraform
  storage_account_base = {
    name                     = local.names.cost_stg
    resource_group_name      = local.names.cor_rgp
    location                 = var.location_va
    account_kind             = "BlockBlobStorage"
    account_tier             = "Premium"
    access_tier              = "Hot"
    account_replication_type = "LRS"
    min_tls_version          = "TLS1_2"
    blob_containers          = [var.cost_container_name]
  }


### Debug Output/Panic Output

```shell
na

Expected Behaviour

Terraform should have been able to read the already deployed resources (they were deployed through terraform) and not error out.

Actual Behaviour

When we updated the provider from 3.47.0 to 3.93.0, the following error was thrown when running terraform apply:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: 1 error occurred:
│ 	* `access_tier` is only available for accounts of kind: [BlobStorage StorageV2 FileStorage]
│ 
│ 
│ 
│   with module.cost_storage_account.azurerm_storage_account.sa,
│   on .terraform/modules/cost_storage_account/modules/storage/main.tf line 5, in resource "azurerm_storage_account" "sa":
│    5: resource "azurerm_storage_account" "sa" {
│ 
╵
##[error]Script failed with exit code: 1

We also tried changing the storage account to "Blob" instead of "BlockBlob" but the following error prevented tf apply from creating the storage account:

╷
│ Error: creating Storage Account (Subscription: "xxx"
│ Resource Group Name: "xxx"
│ Storage Account Name: "xxx"): storage.AccountsClient#Create: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidValuesForRequestParameters" Message="Values for request parameters are invalid: kind, sku. For more information, see - [https://aka.ms/storageaccounttypes"](https://aka.ms/storageaccounttypes%22)
│ 
│   with module.cost_storage_account.azurerm_storage_account.sa,
│   on .terraform/modules/cost_storage_account/modules/storage/main.tf line 5, in resource "azurerm_storage_account" "sa":
│    5: resource "azurerm_storage_account" "sa" {
│ 
╵
##[error]Script failed with exit code: 1

Steps to Reproduce

terraform init terraform plan terraform apply

Important Factoids

No response

References

No response

ChristinaLanaski avatar Feb 27 '24 17:02 ChristinaLanaski

https://github.com/hashicorp/terraform-provider-azurerm/issues/25051

Docs are also strange, just stumbled upon your issue while creating mine. Works with account_kind StorageV2

Netkracker avatar Feb 27 '24 17:02 Netkracker

Linking to a related issue #24782

rcskosir avatar Feb 27 '24 20:02 rcskosir

This issue duplicates to https://github.com/hashicorp/terraform-provider-azurerm/issues/24793, please find the detail and solution from that issue.

magodo avatar Feb 29 '24 01:02 magodo

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[bot] avatar Apr 22 '24 02:04 github-actions[bot]