Remove azure fileshare with RSV backup enabled via terraform gives error of share or snapshots may have active leases
I have two recovery service vaults in two different regions, south east asia and west europe.
But I only get this error message when using terraform to destroy the azure fileshare that has snapshot inside for SEA only. I did the same testing for fileshare in west europe, no error at all.
deleting File Share "seashare" (Account "Account \"myseafileshare\" (IsEdgeZone false / ZoneName \"\" / Subdomain Type \"file\" / DomainSuffix \"core.windows.net\")"): 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.
Both using the same azurerm provider 3.116.0
and I created both RSV using same terraform configuration except location. Both RSV have the soft delete enabled on these properties : Enable soft delete for cloud workloads, Enable soft delete and security settings for hybrid workloads
.
I am able to terraform destroy the seashare
after I turn off the Enable soft delete for cloud workloads, Enable soft delete and security settings for hybrid workloads
and manually delete the snapshot for the seashare.
I checked the lease on the file as well. REST file lease: State -> Available , Lock -> Unlocked
Any idea on why the behaviour could be different when they are having same RSV setting / azure fileshare setting except location?