2017-09-30 1 views
0

에서 나는 파일실행 파워 쉘 스크립트는 Webjob

Write-Output "Getting Azure storage context..." 
    $storageContext = New-AzureStorageContext -StorageAccountName "awemigcitest" -StorageAccountKey "xx+74Z81YJf373p88Emp2jKidMZ8b4/+UTLJT4Rvgqrc8IedRxkg==" 

$ProgressPreference="SilentlyContinue" 
    Set-AzureStorageBlobContent -Blob $azureBlobStorageFileName -File $tempFilename -Container $MigrationReportsContainerName -Context $storageContext -Force 
    Write-Output "Copied HTML file to Azure blob storage." 

을 저장 계정에 conenct 및 업로드 푸른 Webjob에서 PowerShell 스크립트 아래로 실행하고 그러나 오류가 아래 점점. 이것에 대한 어떤 생각? 특성을 설정하면 콘솔 출력 버퍼 속성하면서 [ERR 2017년 9월 30일 6시 41분 20초> 4db5e9] 발생

뉴 AzureStorageContext은 Win32 내부 오류 은 0x6 "핸들 무효".

답변

0

사용중인 명령이 정상적으로 보이지만 로컬 및 Azure WebJob에서 모두 작동합니다. 스크립트가 로컬에서 작동 할 수 있는지 확인하십시오. 게다가 가능하다면 스크립트를 실행하기위한 새로운 WebJob을 생성하고 스크립트가 제대로 작동하는지 확인할 수 있습니다.

Write-Output "Getting Azure storage context..." 
    $storageContext = New-AzureStorageContext -StorageAccountName "{account_name}" -StorageAccountKey "{account_key}" 

$ProgressPreference="SilentlyContinue" 
    Set-AzureStorageBlobContent -Blob 'source.txt' -File 'D:\home\data\jobs\continuous\FileIn.txt' -Container 'mycontainer' -Context $storageContext -Force 
    Write-Output "Copied HTML file to Azure blob storage." 

WebJob 로그

enter image description here

: 나는 사이트 폴더에 액세스 FileIn.txt을 만들 Kudu Console를 사용합니다.