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

DELETE azurerm_storage_share Unable to delete share because one or more share snapshots have active leases #26408

Open
1 task done
mpjtaylor opened this issue Jun 20, 2024 · 6 comments

Comments

@mpjtaylor
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.8.1

AzureRM Provider Version

3.106.1

Affected Resource(s)/Data Source(s)

azurerm_storage_share

Terraform Configuration Files

resource "azurerm_storage_share" "files" {
  name                 = local.sharename
  quota                = var.file_share_quota
  access_tier          = var.backup_share_tier
  storage_account_name = data.azurerm_storage_account.files.name
}

Debug Output/Panic Output

executing request: unexpected status 409 (409 Unable to delete share because one or more share snapshots have active leases. Release the share snapshot leases or delete the share with the include-leased parameter for x-ms-delete-snapshots.) with DeleteShareWhenSnapshotLeased: Unable to delete share because one or more share snapshots have active leases. Release the share snapshot leases or delete the share with the include-leased parameter for x-ms-delete-snapshots

Expected Behaviour

File share should be deleted into soft delete state,

Actual Behaviour

Azure errors cannot perform delete operation because following scope(s) are locked.

This is relatively new issue as we have been using this for along time

Steps to Reproduce

terraform apply
terraform destroy

Important Factoids

Storage account is backed up by Backup Vault

References

No response

@magodo
Copy link
Collaborator

magodo commented Jun 21, 2024

@mpjtaylor Thank you for submitting this issue! I've created a PR to update the underlying SDK. Once it's merged, we shall be able to delete the share with the include-leased parameter for x-ms-delete-snapshots.

@magodo magodo added the bug label Jun 21, 2024
@pc-learning-j
Copy link

pc-learning-j commented Oct 8, 2024

@magodo May I know when will this be merged and closed? I saw this has been in open state for few months. Currently I am facing the similar issue.

@aneeraj
Copy link

aneeraj commented Nov 20, 2024

bump! @magodo any updates on when the related PR will be merged?

@aneeraj
Copy link

aneeraj commented Nov 20, 2024

@pc-learning-j : were you able to workaround this somehow?

@magodo
Copy link
Collaborator

magodo commented Nov 22, 2024

@aneeraj There is one typo in the previous PR, and I've submitted one more PR to fix that. This is to support the functionality via the data plane API.

Since currently there is a major change in the storage share, which changes it to use mgmt plane API: #27733. I've tried to dig into how its delete API supports this use case. Unfortunately, I've met some issue using it. I've created an MSFT internal issue to ask for clarification.

@aneeraj
Copy link

aneeraj commented Nov 22, 2024

Thanks for letting me know, @magodo. Appreciate it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants