Microsoft.WindowsAzure.Storage.Storage.StorageException:远程服务器返回错误:(403)禁止

时间:2019-07-09 09:52:37

标签: c# build azure-devops azure-storage azure-pipelines

  

Microsoft.WindowsAzure.Storage.Storage.StorageException:远程服务器返回错误:(403)禁止

     

StatusMessage:服务器无法验证请求。请确保正确构成Authorization标头的值(包括签名)。

  ErrorCode:AuthenticationFailed

它在localhost中运行,但在Devops构建中不起作用。

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(cnx);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference(containerName); 
if (blobContainer.Exists()){}

本地调试:

picture of working code

测试情况

The same code is running for another test but not for all

0 个答案:

没有答案