0

I am tryting to launch a ZAP scan from Azure devops with the following code

trigger:
- main

pool:
 name: Owasp-Zap Agent
  
steps:
- task: CmdLine@2
  inputs:
    script: 'cd C:\Program Files\OWASP\Zed Attack Proxy'
- task: CmdLine@2
  inputs:
    script: 'java -jar zap-2.11.1.jar -cmd -quickurl https://example.com/ -quickout owaspreport.html'

I have tried all the variations from here , none of them work. I have made the azure agent logon as the only admin account on the VM as well. Doesn't seem to work.

This is the error I keep getting

"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\agent_work_temp\1466a487-8040-4394-970e-ac3ba154a3d6.cmd"" Error: Unable to access jarfile zap-2.11.1.jar

even when it is in the same folder.

Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38

1 Answers1

0

I needed to just add the workingDirectory parameter like so

- script: # script path or inline
  workingDirectory: C:\Program Files\OWASP\Zed Attack Proxy

It wasn't a permission issue or anything.

Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38