【发布时间】:2021-12-28 05:14:20
【问题描述】:
我获得了如下地址,以便使用共享访问签名 (SAS) 将文件上传到 Azure 文件共享
这是我的测试程序
using Azure.Storage.Files.Shares;
public async Task TestAsync()
{
var sas = @"https://myaccount.file.core.windows.net/xxxxx?sv=2020-08-04&ss=bfqt&srt=so&sp=rwdlacupitfx&se=2022-12-30T18:11:32Z&st=2021-12-12T10:11:32Z&spr=https&sig=signature";
var localfile = @"C:\Test\local.txt";
var client = new ShareFileClient(new Uri(sas));
using (var stream = new FileStream(localfile, FileMode.Open, FileAccess.Read))
{
var response = await client.UploadAsync(stream);
}
}
程序抛出 RequestFailedException 并出现以下错误:
Status: 400 (The requested URI does not represent any resource on the server.)
ErrorCode: InvalidUri
Additional Information:
UriPath: /xxxxx
我的问题是这个错误是什么意思,我的测试代码有什么问题吗?
【问题讨论】:
标签: c# azure-files