我已将文本blob上传到azure存储(使用UploadTextASync)。一切都很好,甚至在同一个工作站上再次下载。 问题是当我尝试从其他服务器(阶段)下载它时:
设定:
到目前为止检查过的事情:
回顾:
代码:
public async Task<bool> UploadTextAsync(UploadTextBlobParameter parameter)
{
var container = await EnsureBlobContainerAsync(parameter);
var blob = container.GetBlockBlobReference(parameter.Path);
var blobRequestOptions = await _blobRequestOptionsManager.GetUploadBlobRequestOptions().ConfigureAwait(false);
var exists = await blob.ExistsAsync(blobRequestOptions, null).ConfigureAwait(false);
if (!parameter.Overwrite && exists)
{
return false;
}
await blob.UploadTextAsync(parameter.InputStream, parameter.Encoding, null, blobRequestOptions, null).ConfigureAwait(false);
return true;
}
public async Task<string> DownloadTextAsync(DownloadTextBlobParameter parameter)
{
var container = await EnsureBlobContainerAsync(parameter);
var blob = container.GetBlockBlobReference(parameter.Path);
var blobRequestOptions = _blobRequestOptionsManager.GetDownloadBlobRequestOptions();
var exists = await blob.ExistsAsync(blobRequestOptions, null).ConfigureAwait(false);
if (exists)
{
return await blob.DownloadTextAsync(parameter.Encoding, null, blobRequestOptions, null).ConfigureAwait(false);
}
return null;
}
提前致谢!