Sql Surfer
Sql Surfer

Reputation: 1422

Azure Storage CloudFile custom MetaData API like Azure Storage Explorer

Is there an API for the Azure Storage CloudFile to allow custom metadata.

The MS Tool Azure Storage Explorer has this custom metadata feature available for CloudFile in the FileShare Azure Storage Service.

Existing MS Tool Metadata Editor

Microsoft.WindowsAzure.Storage.File.CloudFile Custom MetaData feature wanted.

Upvotes: 0

Views: 174

Answers (1)

Zhaoxing Lu
Zhaoxing Lu

Reputation: 6467

var file = share.GetRootDirectoryReference().GetFileReference("abc.txt");

// Populates a file's properties and metadata, which triggers a request to Azure File Storage.
file.FetchAttributes();

// Adds new key value pairs into metadata, which is a client-only change.
file.Metadata.Add("Key1", "Value1");
file.Metadata.Add("Key2", "Value2");

// Updates the file's metadata, which triggers a request to Azure File Storage.
file.SetMetadata();

Upvotes: 1

Related Questions