繁体   English   中英

从 Azure 数据工厂 (ADF) 调用 Azure Function 时出现异常

[英]Exception while calling Azure Function from Azure Data Factory (ADF)

我已经设置了一个版本为 2.0 的 Azure Powershell function。 从 Azure 数据工厂 (ADF) 执行 function 时出现异常。

"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"

Function 应用代码

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 函数的初学者。 请帮忙。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM