public async Task ReplaceLatestIndexedAsync( SortedDictionary <string, SortedSet <string> > newData, IAccessCondition accessCondition) { using (_telemetryService.TrackReplaceLatestIndexedOwners(newData.Count)) { var blobName = GetLatestIndexedBlobName(); _logger.LogInformation("Replacing the latest indexed owners from {BlobName}.", blobName); var mappedAccessCondition = new AccessCondition { IfNoneMatchETag = accessCondition.IfNoneMatchETag, IfMatchETag = accessCondition.IfMatchETag, }; var blobReference = Container.GetBlobReference(blobName); using (var stream = await blobReference.OpenWriteAsync(mappedAccessCondition)) using (var streamWriter = new StreamWriter(stream)) using (var jsonTextWriter = new JsonTextWriter(streamWriter)) { blobReference.Properties.ContentType = "application/json"; Serializer.Serialize(jsonTextWriter, newData); } } }