如何使用适用于 Java 的 Azure SDK v12 删除单个 Blob 文件?这是我到目前为止所尝试的。但它不起作用。
顺便说一句,示例代码是 Kotlin:
val blobServiceClient: BlobServiceAsyncClient by lazy {
BlobServiceClientBuilder()
.endpoint(blobProperties.endpoint)
.sasToken(blobProperties.sasToken)
.buildAsyncClient()
}
val containerClient = blobServiceClient.getBlobContainerAsyncClient(blobProperties.containerName)
val blobName = "test.jpg"
val imageClient = containerClient.getBlobAsyncClient(blobName).blockBlobAsyncClient
val deleteImage = imageClient.delete()
println(deleteImage)
我们正在使用库“azure-storage-blob-12.4.0.jar”