public async Task DeleteArchivedBlobsAsync(BlobServiceClient blobServiceClient, string blobContainerName, string blobNameFormat, int retainedBlobCountLimit)
        {
            if (retainedBlobCountLimit < 1)
            {
                throw new ArgumentException("Invalid value provided; retained blob count limit must be at least 1 or null.");
            }

            BlobContainerClient blobContainer = blobServiceClient.GetBlobContainerClient(blobContainerName);
            List <BlobItem>     logBlobs      = new List <BlobItem>();

            AsyncPageable <BlobItem> blobItems = blobContainer.GetBlobsAsync();

            IAsyncEnumerator <BlobItem> enumerator = blobItems.GetAsyncEnumerator();

            try
            {
                while (await enumerator.MoveNextAsync())
                {
                    logBlobs.Add(enumerator.Current);
                }
            }
            finally
            {
                await enumerator.DisposeAsync();
            }

            IEnumerable <BlobItem> validLogBlobs = logBlobs.Where(blobItem => DateTime.TryParseExact(
                                                                      RemoveRolledBlobNameSerialNum(blobItem.Name),
                                                                      blobNameFormat,
                                                                      CultureInfo.InvariantCulture,
                                                                      DateTimeStyles.AssumeLocal,
                                                                      out var _date));

            IEnumerable <BlobItem> blobsToDelete = validLogBlobs
                                                   .OrderByDescending(blobItem => blobItem.Name)
                                                   .Skip(retainedBlobCountLimit);

            foreach (var blobItem in blobsToDelete)
            {
                AppendBlobClient blobToDelete = blobContainer.GetAppendBlobClient(blobItem.Name);

                await blobToDelete.DeleteIfExistsAsync();
            }
        }