public async Task <ActionResponse> DownloadByteAsync(string fileName, string partitionName)
        {
            CloudBlockBlob blockBlob = null;

            byte[] fileContent = null;
            var    blockName   = GetBlockName(partitionName, fileName);

            try
            {
                var retryPolicy = Policy
                                  .Handle <Exception>()
                                  .WaitAndRetryAsync(
                    _maxRetryValueForBlobAction,
                    retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
                    (exception, timeSpan, retryCount, context) =>
                {
                    _logger.LogError($"Retey {retryCount} after {timeSpan.TotalSeconds} of Blob {exception.Message}");
                }
                    );

                await retryPolicy.ExecuteAsync(async() =>
                {
                    if (blockBlob == null)
                    {
                        blockBlob = await GetBlockBlobAsync(_containerName, blockName);
                        await blockBlob.FetchAttributesAsync();
                        long fileByteLength = blockBlob.Properties.Length;
                        fileContent         = new byte[fileByteLength];
                    }

                    if (blockBlob != null)
                    {
                        await blockBlob.DownloadToByteArrayAsync(fileContent, 0);
                    }
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"Unable to download bytes for {blockName}");
                throw ex;
            }

            return(ActionResponse.DownloadSuccessResponse(blockName, fileContent));
        }
        public async Task <ActionResponse> DownloadTextAsync(string fileName, string partitionName)
        {
            CloudBlockBlob blockBlob    = null;
            string         documentText = null;
            var            blockName    = GetBlockName(partitionName, fileName);

            try
            {
                var retryPolicy = Policy
                                  .Handle <Exception>()
                                  .WaitAndRetryAsync(
                    _maxRetryValueForBlobAction,
                    retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
                    (exception, timeSpan, retryCount, context) =>
                {
                    _logger.LogError($"Retey {retryCount} after {timeSpan.TotalSeconds} of Blob {exception.Message}");
                }
                    );

                await retryPolicy.ExecuteAsync(async() =>
                {
                    if (blockBlob == null)
                    {
                        blockBlob = await GetBlockBlobAsync(_containerName, blockName);
                    }

                    if (blockBlob != null)
                    {
                        documentText = await blockBlob.DownloadTextAsync();
                    }
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"Unable to download text for {blockName}");
                throw ex;
            }

            return(ActionResponse.DownloadSuccessResponse(blockName, documentText));
        }