Skip to content

DeployAdfFromArmTask@0 Error with MPEs #185

@merganser

Description

@merganser

Hello :)

I am using the BuildADFTask@1 to compile the project into an arm template then later using the DeployAdfFromArmTask@0 to try and deploy it.

It is currently failing with this error:

##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]Invoke-Expression : At line:1 char:29
##[debug]+ $adf.managedVirtualNetworks/managedPrivateEndpoints.Add($o)
##[debug]+ ~
##[debug]You must provide a value expression following the '/' operator.
##[debug]
##[debug]At line:1 char:29
##[debug]+ $adf.managedVirtualNetworks/managedPrivateEndpoints.Add($o)
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug]Unexpected token 'managedPrivateEndpoints.Add' in expression or statement.
##[debug]At D:\VSTSAgent_Work_tasks\DeployAdfFromArmTask_ecb868a7-3c51-4925-a4b5-c63321b51700\0.35.1778\ps_modules\azure.datafactory.tools\public\Publish-AdfV2UsingArm.ps1:154 char:9
##[debug]+ Invoke-Expression "$adf.$collectionName.Add($o)"
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug] + CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
##[debug] + FullyQualifiedErrorId : ExpectedValueExpression,Microsoft.PowerShell.Commands.InvokeExpressionCommand
##[debug]
##[debug]Script stack trace:
##[debug]at , D:\VSTSAgent_Work_tasks\DeployAdfFromArmTask_ecb868a7-3c51-4925-a4b5-c63321b51700\0.35.1778\ps_modules\azure.datafactory.tools\public\Publish-AdfV2UsingArm.ps1: line 154
##[debug]at Publish-AdfV2UsingArm, D:\VSTSAgent_Work_tasks\DeployAdfFromArmTask_ecb868a7-3c51-4925-a4b5-c63321b51700\0.35.1778\ps_modules\azure.datafactory.tools\public\Publish-AdfV2UsingArm.ps1: line 144
##[debug]at , D:\VSTSAgent_Work_tasks\DeployAdfFromArmTask_ecb868a7-3c51-4925-a4b5-c63321b51700\0.35.1778\DeployArmADF.ps1: line 64

$adf.managedVirtualNetworks/managedPrivateEndpoints.Add($o)

The error points this this file and code section where it sets the $collectionName

azure.datafactory.tools/public/Publish-AdfV2UsingArm.ps1

$arm.resources | ForEach-Object { $ArmType = $_.type $ArmName = $_.name $o = New-Object -TypeName 'AdfObject' $o.name = $ArmName.ToString().Substring(37, $ArmName.ToString().Length - 40) $o.type = ConvertTo-AdfType $ArmType $o.Adf = $adf $o.Body = $_ $adf.Pipelines.Add($o) $collectionName = $ArmType.Substring(32) Invoke-Expression "$adf.$collectionName.Add($o)" }

Is there anything i can do to help this situation? The same value is also used to set $o.type with the function ConvertTo-AdfType so i dont think manually updating the types with powershell before sending to this task will help.

Looks like the adf object is expecting : ManagedPrivateEndpoints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions