az storage share delete --delete-snapshots include-leased not allowed
Describe the bug
When using az storage share delete --name xxx --account-name xxx --account-key xxx --delete-snapshots include-leased
we get
ERROR: az storage share delete: 'include-leased' is not a valid value for '--delete-snapshots'. Allowed values: include.
for blob x-ms-delete-snapshots can be {include, only} as seen in Docs
blob commands allows it
az storage blob delete [--delete-snapshots {include, only}]
for share x-ms-delete-snapshots can be {include, include-leased} as seen in Docs
but share commands do not allow include-leased
az storage share delete [--delete-snapshots {include}]
Expected behavior
being able to use the "include-leased" value.
az storage share delete [--delete-snapshots {include, include-leased}]
Environment summary we use the Docker container with version 2.32.0
Additional context
this was attempted because when using az storage share delete --name xxx --account-name xxx --account-key xxx --delete-snapshots include
we got
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. ErrorCode: DeleteShareWhenSnapshotLeased
<?xml version="1.0" encoding="utf-8"?><Error><Code>DeleteShareWhenSnapshotLeased</Code><Message>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.
RequestId:b5e6aa40-d01a-0027-625a-1709a1000000
Time:2022-02-01T10:57:06.2359390Z</Message></Error>
storage
Any updates for this bug? I'm having the same error these days.
I think the rest api has the bug a well.
uri="https://management.azure.com/subscriptions/$sid/resourceGroups/$rg_name/providers/Microsoft.Storage/storageAccounts/$sa_name/fileServices/default/shares/${sName}?api-version=2023-01-01&$include=leased-snapshots"
az rest --method delete --uri "$uri" --verbose
error:
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.
https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/delete?tabs=HTTP
Hi @pixeye33, opened an issue for the Python SDK, once that is fixed, can support this on the CLI side as well. Thanks.
@calvinhzy issue in azure-sdk-for-python has now been fixed, and hopefully actually is released.
Can you have a look ?