특정 사용자 요청에 응답 할 때 응용 프로그램이 읽을 두 개의 BLOB 저장소 컨테이너가있는 Azure Cloud Services에서 worker 역할로 nodejs 응용 프로그램을 실행하고 있습니다.Nodej를 사용하면 왜 Azure 얼룩 컨테이너에서 읽을 수 있습니까?
내 설정은 다음과 같습니다.
azure-storage 패키지를 사용하여 내 BLOB 저장소와 인터페이스합니다.
두 개의 컨테이너. 각 컨테이너는 사용자가 어느 시점에서 요청할 수있는 여러 유형의 파일을 보유합니다.
은 내가 HTTP 응답에 파일을 스트리밍 다음 코드를 사용 : 나도 용기에서 읽기에는 문제가 없었습니다
중요한exports.getBlobToStream = function(containerName, fileName, res) {
var blobService = azure.createBlobService();
blobService.getBlobProperties(containerName, fileName, function(error, properties, status){
if(error || !status.isSuccessful)
{
res.header('Content-Type', "text/plain");
res.status(404).send("File " + fileName + " not found");
}
else
{
res.header('Content-Type', properties.contentType);
res.header('Content-Disposition', 'attachment; filename=' + fileName);
blobService.createReadStream(containerName, fileName).pipe(res);
}
});
};
한 과거
. 문제에 대한 나의 연구에서 나는 모든 것을 망라하는 azure-sdk-for-node 여기에 동일한 (그러나 구식 인) 이슈를 발견했다. https://github.com/Azure/azure-sdk-for-node/issues/434. 그 문제를 해결 한 해결책도 내 문제를 해결했지만, 나는 그 이유를 이해할 수 없다. 특히 내가 동일한 애플 리케이션 내에서 다른 컨테이너에서 읽을 수 있고 어떤 문제없이 같은 코드를 사용합니다.
나는 해결책과 함께 살 수 있지만 무슨 일이 일어나고 있는지 알고 싶다. 어떤 생각이나 제안?