gpt4 book ai didi

Azure 存储模拟器 403 禁止

转载 作者:行者123 更新时间:2023-12-04 13:13:02 24 4
gpt4 key购买 nike

通过 Nuget,我将 WindowsAzure.Storage 升级到 8.1.1

然后,我下载了 AzureStorageEmulator 5.1.0.0 客户端。

我的连接字符串:

UseDevelopmentStorage=true;

自从之前它显然工作正常以来,我没有对代码进行任何更改。我知道会出现异常:

Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 677
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 604
at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.CreateIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlobContainer.cs:line 233
at C3.Code.Controls.Application.Storage.Blob.Blob.GetContainer(String containerName) in C:\Dropbox\Dropbox (Scirra Ltd)\Tom\C3 Website\C3Alpha2\Code\Controls\Application\Storage\Blob\Blob.cs:line 112
Request Information
RequestID:621bc19f-eb6a-4a98-b19e-f5b01ac22c26
RequestDate:Thu, 27 Apr 2017 16:17:34 GMT
StatusMessage:Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
ErrorCode:AuthenticationFailed
ErrorMessage:Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:621bc19f-eb6a-4a98-b19e-f5b01ac22c26
Time:2017-04-27T16:17:34.5166522Z

当我打电话时

var blobClient = GetClient();
var container = blobClient.GetContainerReference(containerName);
container.CreateIfNotExists(BlobContainerPublicAccessType.Blob);

我发现系统时间会影响这一点,所以我检查了:

Server DateTime.UtcNow = 27/04/2017 16:17:34
Exception RequestDate = Thu, 27 Apr 2017 16:17:34 GMT

有什么想法为什么我在更新客户端和 nuget 包后看到此错误吗?

编辑:GetClient() 代码:

private static CloudBlobClient GetClient()
{
var account = CloudStorageAccount.Parse(Settings.Deployment.AzureConnectionString);
return account.CreateCloudBlobClient();
}

编辑:BaseUri

基本 URI 是: http://127.0.0.1:10000/devstoreaccount1

访问这个我得到:

<Error>
<Code>InvalidQueryParameterValue</Code>
<Message>
Value for one of the query parameters specified in the request URI is invalid. RequestId:9cc906b0-eec6-44b2-bb3d-f77020af4a4c Time:2017-04-27T16:43:16.8538679Z
</Message>
<QueryParameterName>comp</QueryParameterName>
<QueryParameterValue/>
<Reason/>
</Error>

在存储模拟器初始化期间,它显示它已安装到:
(localdb)\MSSQLLocalDBAzureStorageEmulatorDb51

访问:http://127.0.0.1:10000/azurestorageemulatordb51

演出:

<Error>
<Code>OutOfRangeInput</Code>
<Message>
One of the request inputs is out of range. RequestId:dab5e6c1-bc4a-4c65-a4d9-6d44634cb36a Time:2017-04-27T16:47:20.3093597Z
</Message>
</Error>

最佳答案

我遇到了同样的问题,也尝试降级 WindowsAzure.Storage 但没有成功。经过一整天的尝试禁用所有功能后,我发现从startup.cs中删除这一行可以解决问题:

services.AddApplicationInsightsTelemetry(配置);

我不知道为什么这些是相关的,也不知道为什么 ApplicationInsights 会导致 Azure 存储出现问题。我尝试过使用 Microsoft.ApplicationInsights.AspNetCore 版本 2.1.0-beta2 和 2.0.0,两者都会导致 403 错误。

关于Azure 存储模拟器 403 禁止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43662526/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com