PHP SDK를 사용하여 원격 URL에서 azure 저장소로 csv를 업로드하려고합니다. 이 오류가 계속 발생하는 것 같습니다. 나는 곱슬 곱슬 함을 사용하여 SDK없이 시도했지만 여전히 같은 오류가 발생합니다.PHP로 Windows Azure 스토리지에 csv 업로드
<?php
require_once 'vendor/autoload.php';
use MicrosoftAzure\Storage\Common\ServicesBuilder;
use MicrosoftAzure\Storage\Common\ServiceException;
use MicrosoftAzure\Blob\Models\SetBlobPropertiesOptions;
$key = base64_encode("abc");
$connectionString = "DefaultEndpointsProtocol=https;AccountName=username;AccountKey={$key}";
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
// Grab the csv from the remote url
$csv = fopen("http://www.xxxxx.com/wp-cron.phpexport_hash=yyyyyy&export_id=1&action=get_data", "r");
$blobName = "test";
try {
// Upload the blob
$blobRestProxy->createBlockBlob("container", $blobName, $csv);
}
catch(ServiceException $e){
// Errors
$code = $e->getCode();
$errorMessage = $e->getMessage();
}
캔트이 보인다 :
`PUT resulted in a `403 Server failed to authenticate the request.
Make sure the value of Authorization header is formed correctly including the signature.` response:
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate (truncated...)
in C:\wamp64\www\azurescript\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113
여기 내가 사용하고 내 PHP 코드입니다. 어떤 지침은 좋을 것이다