从Azure数据工厂(ADF)调用Azure函数时发生异常

时间:2019-10-29 12:15:11

标签: azure azure-functions azure-data-factory azure-data-factory-2

我已在2.0版中设置了Azure Powershell函数。从Azure数据工厂(ADF)执行该功能时,出现以下异常。

"errorCode": "2011",
    "message": "Could not load file or assembly 'CodeGenerator, Version=1.1.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXXX' or one of its dependencies. The system cannot find the file specified.",
    "failureType": "UserError",
    "target": "Azure Function1"

功能应用代码

using namespace System.Net

# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)

# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."

# Interact with query parameters or the body of the request.
$name = $Request.Query.Name
if (-not $name) {
    $name = $Request.Body.Name
}

if ($name) {
    $status = [HttpStatusCode]::OK
    $body = "Hello $name"
}
else {
    $status = [HttpStatusCode]::BadRequest
    $body = "Please pass a name on the query string or in the request body."
}

# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
    StatusCode = $status
    Body = $body
})

我是Azure Functions的初学者。请帮忙。

1 个答案:

答案 0 :(得分:0)

此问题已解决,请复制OP的评论,对其他有类似问题的人会有所帮助:

  

此问题与集成运行时有关。我从更改了运行时   自托管为自动解决,并且工作正常。