According to this MS-Document
We recommend you perform the stop protection with delete data operation on the backed-up file share. After this operation, Azure Backup will release the lease and delete all snapshots. Then you can delete the file share.
You can use this Azure CLI command it will show the lease status of all shares including snaphots.
az storage share list --account-name xxxx --include-snapshots --query "[?lease.state=='leased'].[name, snapshot]" --output table
Output:
Column1 Column2
--------- ----------------------------
share1 2025-02-14T20:31:45.0000000Z
share1 2025-02-15T20:31:41.0000000Z
share1 2025-02-16T20:31:48.0000000Z
share1 2025-02-17T20:30:42.0000000Z
share1 2025-02-18T20:31:50.0000000Z
share1 2025-02-19T20:31:03.0000000Z
To delete the snapshots with azure file share you can use the below command:
Command:
az storage share delete --name xxx --account-name xxx --delete-snapshots include-leased
Output:
{
"deleted": true
}
The above command will delete the file share with lease snapshots.
Reference:
The above link is useful to do with Azure REST API.
Hope this answer helps! please let us know if you have any further queries. I’m happy to assist you further.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.