Reputation: 23
I have a web job published in a webapp, running Continuous to read file from Azure blob and import data into database. but have problem when load file from AZure, the issue is not happen in the first time, below is the error message:
The remote server returned an error: (404) Not Found. at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand
1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.DownloadRangeToStream(Stream target, Nullable
1 offset, Nullable`1 length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.DownloadToStream(Stream target, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) at BankSearch.FileImporter.Services.FileImportService.d__16.MoveNext()
error happen in the line below
try
{
await fileBlob.DownloadToStreamAsync(fileStream, null, blobRequestOptions, null);
fileStream.Position = 0;
}
catch (StorageException e)
{
// Exception Handling & Logging
logger.Error(
"failed to load the file from Azure blob, file name : >{filename}, error : {error}, {error2}",
fileToProcess.FileName, e.Message, e.StackTrace);
//await SendMappingFailedEmail(fileToProcess, failedColumns);
//return null;
}
to get this error:
can anyone help me to find what's wrong with the webjob? the file from the blob is accessible from webjob.
Upvotes: 0
Views: 410
Reputation: 23
I found the issue , the different file are stored in different blob, and need to Initialize the cloud blob container before read new files
Upvotes: 1