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_storage_share import example is incorrect #28019

Closed
1 task done
robdock92 opened this issue Nov 14, 2024 · 3 comments
Closed
1 task done

azurerm_storage_share import example is incorrect #28019

robdock92 opened this issue Nov 14, 2024 · 3 comments

Comments

@robdock92
Copy link

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 comments along the lines of "+1", "me too" or "any updates", 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

1.9.8

AzureRM Provider Version

4.8.0

Affected Resource(s)/Data Source(s)

azurerm_storage_share

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "azuretest"
  location = "West Europe"
}

resource "azurerm_storage_account" "example" {
  name                     = "azureteststorage"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_storage_share" "example" {
  name               = "sharename"
  storage_account_id = azurerm_storage_account.example.id
  quota              = 50

  acl {
    id = "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"

    access_policy {
      permissions = "rwdl"
      start       = "2019-07-02T09:38:21Z"
      expiry      = "2019-07-02T10:38:21Z"
    }
  }
}

Debug Output/Panic Output

2024-11-14T15:23:08.703Z [ERROR] vertex "azurerm_storage_share.example (import id \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename\")" error: parsing account "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename": expected the account "" to use a domain suffix of "core.windows.net"

2024-11-14T15:23:08.703Z [ERROR] provider.terraform-provider-azurerm_v4.8.0_x5: Response contains error diagnostic: tf_proto_version=5.6 tf_req_id=0a9cfc27-5364-75fe-025a-0561993b2efd tf_rpc=ImportResourceState @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_severity=ERROR diagnostic_detail="" diagnostic_summary="parsing account \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename\": expected the account \"\" to use a domain suffix of \"core.windows.net\"" tf_provider_addr=registry.terraform.io/hashicorp/azurerm tf_resource_type=azurerm_storage_share @module=sdk.proto timestamp=2024-11-14T15:23:08.703Z

2024-11-14T15:23:08.704Z [ERROR] vertex "azurerm_storage_share.example (expand)" error: parsing account "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename": expected the account "" to use a domain suffix of "core.windows.net"

╷
│ Error: parsing account "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename": expected the account "" to use a domain suffix of "core.windows.net"
│
│
╵

(resource names scrubbed to match above example code)

Expected Behaviour

Import successful!

The resources that were imported are shown above. These resources are now in your Terraform state and will henceforth be managed by Terraform.

Actual Behaviour


│ Error: parsing account "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename": expected the account "" to use a domain suffix of "core.windows.net"


Steps to Reproduce

  • terraform apply the above code
  • Make a new fileshare in the existing Storage Account using the Portal named "sharename2"
  • Make a new resource named "example2" in your terraform code for this newly created fileshare
  • Construct the import string for the new manually created fileshare
  • Attempt to import via :
terraform import azurerm_storage_share.example2 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azuretest/providers/Microsoft.Storage/storageAccounts/azureteststorage/fileServices/default/shares/sharename2
  • You will receive the error as described in the Actual Behavior section
  • You can successfully import using a different resource identification method:
terraform import azurerm_storage_share.example2 https://azureteststorage.file.core.windows.net/sharename2

Important Factoids

No response

References

No response

@magodo
Copy link
Collaborator

magodo commented Nov 15, 2024

Hey @robdock92, sorry for running into this.. The import spec has been updated since v4.9.0, by #27733. Since you are still on v4.8.0, the https://azureteststorage.file.core.windows.net/sharename2 shall work for you.

@robdock92
Copy link
Author

@magodo Good point, didn't check that at all. Thank you for the response!

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 Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants