1
votes

I'm trying out Azure Blob Change Feed feature and it behaves strange to me with Append Blobs: append events are missing in the feed.

My scenario is:

  1. Create storage account, enable change feed feature: Change feed enabled

  2. Create Append Blob if not exists (1) and appending some input into it (2).

     private void WriteBlob(string input)
     {
         MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(input));
    
         try
         {
             if (client == null)
             {                    
                 var credential = new ClientSecretCredential("...", "...");
                 client = new AppendBlobClient(new Uri("..."), credential);
             }
    
             client.CreateIfNotExists(); // (1)
             client.AppendBlock(stream); // (2)
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.Message);
         }
     }
    
  3. Fetch Change Feed entries in separate console app.

     public static List<BlobChangeFeedEvent> GetChanges()
     {
         var credential = new ClientSecretCredential("...", "...");
         BlobChangeFeedClient blobChangeFeedClient = new BlobChangeFeedClient(new Uri("..."), credential);
    
         List<BlobChangeFeedEvent> events = new List<BlobChangeFeedEvent>();
         foreach (BlobChangeFeedEvent changeFeedEvent in blobChangeFeedClient.GetChanges())
         {
             events.Add(changeFeedEvent);
         }
         return events;
     }
    

The problem is that after a few runs of WriteBlob method I only get single change feed event that corresponds to the blob creation, and subsequent appends are missing in the feed, however inputs are being appended successfully to the blob resource.

The question is why it is working this way? I didn't find anything special about Append Blob blob type regarding Change feed in docs.

1
The "append event type" is not supported, you can refer to the answer below for more details. And if the answer is helpful, could you please accept it as answer, as per this link? Thanks.Ivan Yang

1 Answers

1
votes

Currently, the append event for an append blob is not supported.

As per this doc, only the following event types are supported:

  • BlobCreated

  • BlobDeleted

  • BlobPropertiesUpdated

  • BlobSnapshotCreated

And in the source code of Azure.Storage.Blobs.ChangeFeed package, there is no append event type.

A feature request of this is submitted, hope it can be added in the future release.