Explore Courses Blog Tutorials Interview Questions
0 votes
in Azure by (17.6k points)

I have setup version 2.0 of the Azure Powershell feature.
The function from Azure Data Factory (ADF) gets below exception when executing.

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

Function App Code

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

1 Answer

0 votes
by (47.2k points)
edited by

This problem was with runtime integration. I switched from self-hosted to auto-resolved runtime and it is working fine.

Check out Azure Data Factory Training that enables you to master your skills in Data Factory

Browse Categories