PDF 파일을 만들고 해당 파일을 Azure Blob 저장소에 업로드하는 Azure Web Job (WebApp과 함께 제공되는 간단한 작업)으로 powershell 스크립트를 실행하려고합니다. (쿠두 포털에서) 푸른 웹 작업 로그에 표시됩니다 내가 메시지를 다음 한 결과Azure WebJob Powershell 스크립트를 사용하여 Azure Blob 저장소에 파일을 업로드하십시오.
$pdfFileName = $reportId + ".pdf";
$storageAccountName = "MY-STORE"
$storageAccountKey = "MY-KEY"
$containerName = "_MY_CONTAINER"
$fullFileName = $PSScriptRoot + "\" + $pdfFileName
$ctx = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
Set-AzureStorageBlobContent -File "$fullFileName" -Container $containerName -Blob $pdfFileName -Context $ctx -Force
: 파일이 성공적으로 다음 명령을 사용하여 파일 업로드시 오류가 생성됩니다.
[11/15/2016 15:20:24 > 89499f: ERR ] Set-AzureStorageBlobContent : Win32 internal error "The handle is invalid" 0x6
[11/15/2016 15:20:24 > 89499f: ERR ] occurred while reading the console output buffer. Contact Microsoft Customer
[11/15/2016 15:20:24 > 89499f: ERR ] Support Services.
[11/15/2016 15:20:24 > 89499f: ERR ] At
[11/15/2016 15:20:24 > 89499f: ERR ] D:\local\Temp\jobs\triggered\ddd\orgmoz1g.dqi\generateAndUploadReports.ps1:53
[11/15/2016 15:20:24 > 89499f: ERR ] char:3
[11/15/2016 15:20:24 > 89499f: ERR ] + Set-AzureStorageBlobContent -File $fullFileName -Container
[11/15/2016 15:20:24 > 89499f: ERR ] $containerName -Blo ...
[11/15/2016 15:20:24 > 89499f: ERR ] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[11/15/2016 15:20:24 > 89499f: ERR ] ~~~~~~
[11/15/2016 15:20:24 > 89499f: ERR ] + CategoryInfo : ReadError: (:) [Set-AzureStorageBlobContent], Ho
[11/15/2016 15:20:24 > 89499f: ERR ] stException
[11/15/2016 15:20:24 > 89499f: ERR ] + FullyQualifiedErrorId : ReadConsoleOutput,Microsoft.WindowsAzure.Command
[11/15/2016 15:20:24 > 89499f: ERR ] s.Storage.Blob.SetAzureBlobContentCommand
동일한 스크립트가 로컬 컴퓨터에서 올바르게 작동합니다. Get-Module -ListAvailable을 사용하여 사용 가능한 모듈을 나열하기 위해 webjob을 만들었을 때 다음과 같은 모듈을 받았습니다.
...
[11/15/2016 15:40:36 > 89499f: INFO] ModuleType Version Name ExportedCommands
[11/15/2016 15:40:36 > 89499f: INFO] ---------- ------- ---- ----------------
[11/15/2016 15:40:36 > 89499f: INFO] Manifest 1.4.0 Azure {Get-AzureAutomati...
...
[11/15/2016 15:40:36 > 89499f: INFO] ModuleType Version Name ExportedCommands
[11/15/2016 15:40:36 > 89499f: INFO] ---------- ------- ---- ----------------
[11/15/2016 15:40:36 > 89499f: INFO] Manifest 1.1.2 Azure.Storage {Get-AzureStorageB...
...
이 모든 시간을 사용하지 주시기 바랍니다 새로 고침하거나 SCM 웹 기반 PS 콘솔로 이동하십시오. 이 문제를 참조하십시오 : https://github.com/projectkudu/kudu/issues/2172 –
브루스가 제안한 해결책이 내가 찾고있는 해결책입니다. 이제 모든 것이 올바르게 작동합니다. 감사. –