我已经用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功能的初学者。请帮忙。
这个问题已经解决,复制OP的评论,这将有助于其他有类似问题的人:
此问题与集成运行时有关。我更改了运行时自托管到自动解析,工作正常。