Share via

DevOps Release pipeline error - Cannot find a variable with the name 'AmsiContext'

Anonymous
2022-03-16T14:32:45.107+00:00

We're using DevOps release pipeline to deploy BizTalk 2020 applications using the standard "Deploy BizTalk Server Application" agent task.

This has been working without any issues until around Feb this year and now after the deployment we get the following error reported:

(N.B. The actual BizTalk application deployment works however the error is stopping any further tasks from running.)

Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.Cannot find a variable with the name 'AmsiContext'.Cannot find a variable with the name 'AmsiInitFailed'.
2022-03-09T12:30:25.1141516Z ##[error]Exit code 1 returned from process: file name 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', arguments '-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if ([Console]::InputEncoding -is [Text.UTF8Encoding] -and [Console]::InputEncoding.GetPreamble().Length -ne 0) { [Console]::InputEncoding = New-Object Text.UTF8Encoding $false } if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; Import-Module -Name 'D:\agentDevOps_work_tasks\BizTalkApplicationDeploy_4c06323d-3802-4194-ae7b-1c249e76dd8f\2.0.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'SilentlyContinue' ; $DebugPreference = 'SilentlyContinue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''D:\agentDevOps_work_tasks\BizTalkApplicationDeploy_4c06323d-3802-4194-ae7b-1c249e76dd8f\2.0.0\Start-Deployment.ps1'''))"'.

Have found a similar issue - https://developercommunity.visualstudio.com/t/Release-Pipeline-suddenly-failing-with:-/1596275#T-N1597077

The solution talks about disabling PowerShell protection in the Sentinel One windows agent, however my security team are concerned this might open up a vulnerability on the server.

Does anyone know an alternative solution to resolving this issue?

BizTalk Server
BizTalk Server

A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-03-16T14:35:59.43+00:00

    The product group for Azure DevOps / TFS actively monitors questions over at
    https://developercommunity.visualstudio.com/report?space=21&entry=problem
    https://developercommunity.visualstudio.com/report?space=22&entry=problem

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.