azure-pipelines-tasks: [BUG]: Error: Unrecognized argument '"-setParam:name='IIS Web Application Name',value='{REDACTED}'"'. All arguments must begin with "-"

Task name

AzureRmWebAppDeployment

Task version

4.226.0

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows Server 2019 Datacenter

Task log

2023-08-14T08:48:52.9016125Z ##[debug]Constructed msDeploy comamnd line arguments
2023-08-14T08:48:52.9311743Z ##[debug]System.DefaultWorkingDirectory=C:\a\5\s
2023-08-14T08:48:52.9314007Z ##[debug]the argument string is:
2023-08-14T08:48:52.9315440Z ##[debug] -verb:sync -source:package="'C:\a\5\{REDACTED}\{REDACTED}.zip'" -dest:auto,ComputerName="'https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}'",UserName="'${REDACTED}'",Password="'{REDACTED}'",AuthType="'Basic'" -setParam:name="'IIS Web Application Name'",value="'{REDACTED}'" -enableRule:AppOffline -setParamFile=1692002930883_tempSetParameters.xml  -skip:Directory=App_Data -retryAttempts:6 -retryInterval:10000 -userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0
2023-08-14T08:48:52.9316698Z ##[debug]converting the argument string into an array of arguments
2023-08-14T08:48:52.9317154Z ##[debug]the array of arguments is:
2023-08-14T08:48:52.9317540Z ##[debug]arg#0: -verb:sync
2023-08-14T08:48:52.9317946Z ##[debug]arg#1: -source:package='C:\a\5\{REDACTED}\{REDACTED}.zip'
2023-08-14T08:48:52.9318604Z ##[debug]arg#2: -dest:auto,ComputerName='https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}',UserName='${REDACTED}',Password='{REDACTED}',AuthType='Basic'
2023-08-14T08:48:52.9319275Z ##[debug]arg#3: -setParam:name='IIS Web Application Name',value='{REDACTED}'
2023-08-14T08:48:52.9319744Z ##[debug]arg#4: -enableRule:AppOffline
2023-08-14T08:48:52.9320168Z ##[debug]arg#5: -setParamFile=1692002930883_tempSetParameters.xml
2023-08-14T08:48:52.9320594Z ##[debug]arg#6: -skip:Directory=App_Data
2023-08-14T08:48:52.9320982Z ##[debug]arg#7: -retryAttempts:6
2023-08-14T08:48:52.9321389Z ##[debug]arg#8: -retryInterval:10000
2023-08-14T08:48:52.9321851Z ##[debug]arg#9: -userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0
2023-08-14T08:48:52.9322281Z ##[debug]which 'msdeploy'
2023-08-14T08:48:52.9322781Z ##[debug]found: 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'
2023-08-14T08:48:52.9324057Z ##[debug]C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe arg: ["-verb:sync","-source:package='C:\\a\\5\\{REDACTED}\\{REDACTED}.zip'","-dest:auto,ComputerName='https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}',UserName='${REDACTED}',Password='{REDACTED}',AuthType='Basic'","-setParam:name='IIS Web Application Name',value='{REDACTED}'","-enableRule:AppOffline","-setParamFile=1692002930883_tempSetParameters.xml","-skip:Directory=App_Data","-retryAttempts:6","-retryInterval:10000","-userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0"]
2023-08-14T08:48:52.9326154Z ##[debug]C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe arg: ["-verb:sync","-source:package='C:\\a\\5\\{REDACTED}\\{REDACTED}.zip'","-dest:auto,ComputerName='https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}',UserName='${REDACTED}',Password='{REDACTED}',AuthType='Basic'","-setParam:name='IIS Web Application Name',value='{REDACTED}'","-enableRule:AppOffline","-setParamFile=1692002930883_tempSetParameters.xml","-skip:Directory=App_Data","-retryAttempts:6","-retryInterval:10000","-userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0"]
2023-08-14T08:48:52.9327269Z ##[debug]exec tool: C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe
2023-08-14T08:48:52.9327771Z ##[debug]exec tool: C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe
2023-08-14T08:48:52.9328132Z ##[debug]arguments:
2023-08-14T08:48:52.9328433Z ##[debug]arguments:
2023-08-14T08:48:52.9328754Z ##[debug]   -verb:sync
2023-08-14T08:48:52.9329067Z ##[debug]   -verb:sync
2023-08-14T08:48:52.9329420Z ##[debug]   -source:package='C:\a\5\{REDACTED}\{REDACTED}.zip'
2023-08-14T08:48:52.9329827Z ##[debug]   -source:package='C:\a\5\{REDACTED}\{REDACTED}.zip'
2023-08-14T08:48:52.9330446Z ##[debug]   -dest:auto,ComputerName='https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}',UserName='${REDACTED}',Password='{REDACTED}',AuthType='Basic'
2023-08-14T08:48:52.9331193Z ##[debug]   -dest:auto,ComputerName='https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}',UserName='${REDACTED}',Password='{REDACTED}',AuthType='Basic'
2023-08-14T08:48:52.9332288Z ##[debug]   -setParam:name='IIS Web Application Name',value='{REDACTED}'
2023-08-14T08:48:52.9332730Z ##[debug]   -setParam:name='IIS Web Application Name',value='{REDACTED}'
2023-08-14T08:48:52.9333124Z ##[debug]   -enableRule:AppOffline
2023-08-14T08:48:52.9333482Z ##[debug]   -enableRule:AppOffline
2023-08-14T08:48:52.9333848Z ##[debug]   -setParamFile=1692002930883_tempSetParameters.xml
2023-08-14T08:48:52.9334234Z ##[debug]   -setParamFile=1692002930883_tempSetParameters.xml
2023-08-14T08:48:52.9334610Z ##[debug]   -skip:Directory=App_Data
2023-08-14T08:48:52.9334965Z ##[debug]   -skip:Directory=App_Data
2023-08-14T08:48:52.9335313Z ##[debug]   -retryAttempts:6
2023-08-14T08:48:52.9335661Z ##[debug]   -retryAttempts:6
2023-08-14T08:48:52.9336003Z ##[debug]   -retryInterval:10000
2023-08-14T08:48:52.9336344Z ##[debug]   -retryInterval:10000
2023-08-14T08:48:52.9336734Z ##[debug]   -userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0
2023-08-14T08:48:52.9337173Z ##[debug]   -userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0
2023-08-14T08:48:52.9338217Z [command]"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\a\5\{REDACTED}\{REDACTED}.zip' -dest:auto,ComputerName='https://{REDACTED}.scm.azurewebsites.net:443/msdeploy.axd?site={REDACTED}',UserName='${REDACTED}',Password='{REDACTED}',AuthType='Basic' "-setParam:name='IIS Web Application Name',value='{REDACTED}'" -enableRule:AppOffline -setParamFile=1692002930883_tempSetParameters.xml -skip:Directory=App_Data -retryAttempts:6 -retryInterval:10000 -userAgent:VSTS_21511a7c-2ec5-470e-8b8b-964cec1d8cd5_build_36_0
2023-08-14T08:48:53.5341469Z ##[debug]Exit code 4294967295 received from tool 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'
2023-08-14T08:48:53.5342031Z ##[debug]Exit code 4294967295 received from tool 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'
2023-08-14T08:48:53.5342515Z ##[debug]STDIO streams have closed for tool 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'
2023-08-14T08:48:53.5342808Z ##[debug]STDIO streams have closed for tool 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'
2023-08-14T08:48:53.5346960Z ##[debug]System.DefaultWorkingDirectory=C:\a\5\s
2023-08-14T08:48:53.5350961Z ##[debug]rm -rf 1692002930883_tempSetParameters.xml
2023-08-14T08:48:53.5352445Z ##[debug]removing file 1692002930883_tempSetParameters.xml
2023-08-14T08:48:53.5514076Z ##[debug]Deployment Failed with Error: Error: Error: Unrecognized argument '"-setParam:name='IIS Web Application Name',value='{REDACTED}'"'. All arguments must begin with "-".
Error count: 1.

2023-08-14T08:48:53.5514500Z ##[debug]task result: Failed
2023-08-14T08:48:53.5541343Z ##[error]Error: Error: Unrecognized argument '"-setParam:name='IIS Web Application Name',value='{REDACTED}'"'. All arguments must begin with "-".
Error count: 1.

2023-08-14T08:48:53.5546977Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Error: Unrecognized argument '"-setParam:name='IIS Web Application Name',value='{REDACTED}'"'. All arguments must begin with "-".
Error count: 1.

2023-08-14T08:48:53.5548210Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Error: Unrecognized argument '"-setParam:name='IIS Web Application Name',value='{REDACTED}'"'. All arguments must begin with "-".
Error count: 1.

Relevant log output

Error: Error: Unrecognized argument '"-setParam:name='IIS Web Application Name',value='{REDACTED}'"'. All arguments must begin with "-"

Aditional info

4.225.1 version worked as expected. Started failing with 4.226.0.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 24 (4 by maintainers)

Most upvoted comments

Until fixed, we are mitigating by pegging the affected pipeline task to an unaffected version, e.g. IISWebAppDeploymentOnMachineGroup@0.222.0 Instead of IISWebAppDeploymentOnMachineGroup@0

@jockeEk Are you running old instances of your deployment pipeline or new deployments? I had the same problem when retrying to run a failed stage but it worked when I re-ran the pipeline.

@DmitriiBobreshev Yes, it is working now (after I changed my task back to AzureRmWebAppDeployment@4).

Thank you!

Same problem here with: IISWebAppDeploymentOnMachineGroup@0

JSON variable substitution applied successfully.
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\AzDevopsAgent\_work\2\s\temp_web_package_7150849068665126.zip' -dest:auto -setParam:name='IIS Web Application Name',value='IncidentApi' -enableRule:DoNotDeleteRule
Error: The process 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' failed with exit code 4294967295
    at ExecState._setResult (C:\AzDevopsAgent\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.226.0\node_modules\azure-pipelines-task-lib\toolrunner.js:943:25)
    at ExecState.CheckComplete (C:\AzDevopsAgent\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.226.0\node_modules\azure-pipelines-task-lib\toolrunner.js:926:18)
    at ChildProcess.<anonymous> (C:\AzDevopsAgent\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.226.0\node_modules\azure-pipelines-task-lib\toolrunner.js:839:19)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1093:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Retrying to deploy the package.
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\AzDevopsAgent\_work\2\s\temp_web_package_7150849068665126.zip' -dest:auto -setParam:name='IIS Web Application Name',value='IncidentApi' -enableRule:DoNotDeleteRule
Error: The process 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' failed with exit code 4294967295
    at ExecState._setResult (C:\AzDevopsAgent\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.226.0\node_modules\azure-pipelines-task-lib\toolrunner.js:943:25)
    at ExecState.CheckComplete (C:\AzDevopsAgent\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.226.0\node_modules\azure-pipelines-task-lib\toolrunner.js:926:18)
    at ChildProcess.<anonymous> (C:\AzDevopsAgent\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.226.0\node_modules\azure-pipelines-task-lib\toolrunner.js:839:19)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1093:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Retrying to deploy the package.
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\AzDevopsAgent\_work\2\s\temp_web_package_7150849068665126.zip' -dest:auto -setParam:name='IIS Web Application Name',value='IncidentApi' -enableRule:DoNotDeleteRule
##[error]Failed to deploy web package to IIS website.
##[error]Error: Unrecognized argument 'Files\IIS\Microsoft'. All arguments must begin with "-".
Error count: 1.

##[error]Error: The process 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' failed with exit code 4294967295
Finishing: Deploy IIS Website/App: 

Until fixed, we are mitigating by pegging the affected pipeline task to an unaffected version, e.g. IISWebAppDeploymentOnMachineGroup@0.222.0 Instead of IISWebAppDeploymentOnMachineGroup@0

This got us working, thanks @davemandy

Hi @BRGROSU, and @akozak-mirango, thank you for the feedback, we’re preparing a fix for the tasks, and I’ll keep you updated