diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md b/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md index 6eb4529bc..b48a0747b 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md @@ -54,6 +54,7 @@ This component supports **output binding** with the following operations: - `create` : [Create blob](#create-blob) - `get` : [Get blob](#get-blob) +- `delete` : [Delete blob](#delete-blob) ### Create blob @@ -201,6 +202,82 @@ To perform a get blob operation, invoke the Azure Blob Storage binding with a `P The response body contains the value stored in the blob object. +### Delete blob + +To perform a delete blob operation, invoke the Azure Blob Storage binding with a `POST` method and the following JSON body: + +```json +{ + "operation": "delete", + "metadata": { + "blobName": "myblob" + } +} +``` + +#### Examples + +##### Delete blob + +{{< tabs Windows Linux >}} + + {{% codetab %}} + ```bash + curl -d '{ \"operation\": \"delete\", \"metadata\": { \"blobName\": \"myblob\" }}' http://localhost:/v1.0/bindings/ + ``` + {{% /codetab %}} + + {{% codetab %}} + ```bash + curl -d '{ "operation": "delete", "metadata": { "blobName": "myblob" }}' \ + http://localhost:/v1.0/bindings/ + ``` + {{% /codetab %}} + +{{< /tabs >}} + +##### Delete blob snapshots only + +{{< tabs Windows Linux >}} + + {{% codetab %}} + ```bash + curl -d '{ \"operation\": \"delete\", \"metadata\": { \"blobName\": \"myblob\", \"DeleteSnapshotOptions\": \"only\" }}' http://localhost:/v1.0/bindings/ + ``` + {{% /codetab %}} + + {{% codetab %}} + ```bash + curl -d '{ "operation": "delete", "metadata": { "blobName": "myblob", "DeleteSnapshotOptions": "only" }}' \ + http://localhost:/v1.0/bindings/ + ``` + {{% /codetab %}} + +{{< /tabs >}} + +##### Delete blob including snapshots + +{{< tabs Windows Linux >}} + + {{% codetab %}} + ```bash + curl -d '{ \"operation\": \"delete\", \"metadata\": { \"blobName\": \"myblob\", \"DeleteSnapshotOptions\": \"include\" }}' http://localhost:/v1.0/bindings/ + ``` + {{% /codetab %}} + + {{% codetab %}} + ```bash + curl -d '{ "operation": "delete", "metadata": { "blobName": "myblob", "DeleteSnapshotOptions": "include" }}' \ + http://localhost:/v1.0/bindings/ + ``` + {{% /codetab %}} + +{{< /tabs >}} + +#### Response + +An HTTP 204 (No Content) and empty body will be retuned if successful. + ## Metadata information By default the Azure Blob Storage output binding auto generates a UUID as the blob filename and is not assigned any system or custom metadata to it. It is configurable in the metadata property of the message (all optional).