hammies
hammies

Reputation: 1435

Setting Metadata on azure blob in js

I see examples for c#, but I cannot find implement info for js. How do I set metadata for blob in js?

const metadata = {name, selection}

await blockBlobClient.upload(file);
await blockBlobClient.setMetadata(container, file, metadata)

I am looking at this link and it calls setMetadata but it doesn't set:

http://azure.github.io/azure-storage-node/BlobService.html#setBlobMetadata__anchor

Upvotes: 1

Views: 1119

Answers (1)

kavya Saraboju
kavya Saraboju

Reputation: 10831

Thank you @gaurav mantri for your suggestion..

Converting your suggestion as answer to help reach other community members.

solution by @gaurav mantri:

To set metadata for blob in js ,you may use

setMetadata(metadata?: Metadata, options?: BlobSetMetadataOptions) when using new azure-storage SDK (azure sdk for java script) as the old azure-storage SDK is deprecated .

Please Refer these for the same :

BlockBlobClient class | Microsoft Docs

BlobSetMetadataOptions interface | Microsoft Docs

Upvotes: 1

Related Questions