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:
Create storage account, enable change feed feature: Change feed enabled
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); } }
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.