2015-02-05 2 views
0

다음 요청 succceses를 금지 :(204)는 푸른 저장에

HEAD https://ascendxyzweutest.blob.core.windows.net/b89e6c6cdde0421996a7ba47fcb57184-workset?restype=container HTTP/1.1 
User-Agent: WA-Storage/4.3.0 (.NET CLR 4.0.30319.0; Win32NT 6.2.9200.0) 
x-ms-version: 2014-02-14 
x-ms-client-request-id: b566c59d-b8ac-4b7e-9cfc-820337971cc9 
x-ms-date: Thu, 05 Feb 2015 00:59:17 GMT 
Authorization: SharedKey ascendxyzweutest:+KdHX5Bewm5uP4lPHUtEcCv79tC3dQK28evyg1trOlw= 
Host: ascendxyzweutest.blob.core.windows.net 
Connection: Keep-Alive 

응답 : 위의 예는 TEH에서입니다

HTTP/1.1 404 The specified container does not exist. 
Transfer-Encoding: chunked 
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 
x-ms-request-id: 2fa4a112-0001-0010-7b56-b4eb01000000 
x-ms-version: 2014-02-14 
Date: Thu, 05 Feb 2015 00:59:23 GMT 

가 저장 라이브러리 .NET

그럼 내가 WebRequest 클래스 노력으로 오전 같은 것을하기.

HEAD https://ascendxyzweutest.blob.core.windows.net/ccf2a083affa4e6c8d489fe1b2f0d32a-workset?restype=container HTTP/1.1 
x-ms-version: 2014-02-14 
x-ms-client-request-id: 92afdcaf-5afe-4f6a-914e-4850a4f0bd1d 
x-ms-date: Thu, 05 Feb 2015 01:01:56 GMT 
Authorization: SharedKey ascendxyzweutest:LRoIdLp0m4nR0XhRlcTT7gyyi6zYJhGg3fHmXKemPVc= 
Host: ascendxyzweutest.blob.core.windows.net 
Connection: Keep-Alive 

회신 :

HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. 
Transfer-Encoding: chunked 
Server: Microsoft-HTTPAPI/2.0 
x-ms-request-id: 61b7318c-0001-001c-6cc4-b6edcd000000 
Date: Thu, 05 Feb 2015 01:02:22 GMT 

이에 다른 모든 게시물을 제안 자사의 15 분 이상으로 꺼져있는 X-MS-날짜 필드. 나는이 기계를 5 분 간격으로 동일한 기계에서 실행 시켰으며 이것은 요청 헤더에 보이는 것과 같다. 그래서 나는 그 시간이 없다고 생각하지 않는다.

내가 Azure Storage SDK의 항목 양식을 사용하여 요청에 서명하고 있습니다.

public Task SignRequestAsync(HttpWebRequest request, string tenantid, string container) 
     { 
      var a = new SharedKeyAuthenticationHandler(SharedKeyCanonicalizer.Instance, account.Credentials, account.Credentials.AccountName); 
      a.SignRequest(request,null); 
      return Task.FromResult(0); 

     } 

잘못 될 수있는 것에 대한 안내입니다.

답변

0

Gaurav Mantri가이 문제를 해결하고 문제를 발견했습니다. 이 문제는 서명을 계산할 때 사용 된 일부 헤더가 설정 되었기 때문에 발생했지만이 헤더는 요청을 수행 할 때 생략되었습니다. Content-Length가 0 ect로 설정됩니다.

컨테이너가 있는지 확인하면 문제가 "HEAD"요청과 관련이 있습니다. 기본적으로 서명을 계산할 때 "Content-Length"를 전달하지만 (값이 0 임에도 불구하고) 요청 헤더로 전달되지 않습니다. 따라서 서명이 일치하지 않으면 403 오류가 발생합니다. 요청의 "ContentLength"속성을 설정 한 코드를 주석 처리하면 "HEAD"요청이 성공하지만 PUT 요청이 실패합니다.