Search code examples
azureazure-blob-storageazure-storage

Azure Storage Directory Delete Error. ErrorCode: EndpointUnsupportedAccountFeatures


Detailed Error:

ERROR: This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint. ErrorCode: EndpointUnsupportedAccountFeatures
{"error":{"code":"EndpointUnsupportedAccountFeatures","message":"This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint.\nRequestId:2ca07dd4-f01f-0049-5939-8a9044000000\nTime:2022-06-27T15:23:27.4308391Z"}}

The Command that I am using to Delete Blob Storage Directory:

az account set --subscription ${my_subscriptions[$i]}
az storage blob directory delete -c ${my_container[$i]} --account-name ${my_acc_name[$i]} -d ${my_source[$i]} --recursive

When I run "az storage account blob-service-properties show --account-name my_acc_name" I get following output:

{
  "automaticSnapshotPolicyEnabled": null,
  "changeFeed": {
    "enabled": false,
    "retentionInDays": null
  },
  "containerDeleteRetentionPolicy": {
    "days": 7,
    "enabled": true
  },
  "cors": {
    "corsRules": []
  },
  "defaultServiceVersion": null,
  "deleteRetentionPolicy": {
    "allowPermanentDelete": false,
    "days": 7,
    "enabled": true
  },
  "id": "/subscriptions/0813acfc-11cd-493d-a7fc-8f230ce7bfb6/resourceGroups/team/providers/Microsoft.Storage/storageAccounts/myaccname/blobServices/default",
  "isVersioningEnabled": false,
  "lastAccessTimeTrackingPolicy": null,
  "name": "default",
  "resourceGroup": "team",
  "restorePolicy": {
    "days": null,
    "enabled": false,
    "minRestoreTime": null
  },
  "sku": {
    "name": "Standard_RAGRS",
    "tier": "Standard"
  },
  "type": "Microsoft.Storage/storageAccounts/blobServices"
}

Can someone please explain me the above ERROR that I am getting and a solution to get rid off this error?


Solution

  • ERROR: This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint. ErrorCode: EndpointUnsupportedAccountFeatures
    {"error":{"code":"EndpointUnsupportedAccountFeatures","message":"This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint.\nRequestId:2ca07dd4-f01f-0049-5939-8a9044000000\nTime:2022-06-27T15:23:27.4308391Z"}}
    

    This error mentioning like you are enable soft delete for containers check whether its Enable

    Go to Azure portal -> storage account -> under data management -> data protection -> Disable soft delete as below

    enter image description here

       az storage blob service-properties delete-policy show
       --account-name *****
       --query 'enabled': false
    

    To delete Blob Storage Directory try using below command

    az storage blob directory delete -c MyContainer -d MyDirectoryPath --account-name MyStorageAccount
    

    Storage account have Hierarchical Namespace enabled if yes, then the delete action can be atomic and immediately; if not, the operation is performed in batches and a continuation token could be returned.

    For you Information check this Ref1 & Ref2