Devops release to fail if ping do not return a 200

Nibbler 591 Reputation points
2022-11-17T11:56:56.42+00:00

Hello all.

I`m looking into how I can make a release fails if the ping of a URL does not return a 200. However, I can find any documentation on DevOps or any PowerShell in how to do this.

Anybody have a good approach to add to do this with a Azure Powershell step in DevOps, release-pipeline…

261405-capture.png

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,891 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 39,011 Reputation points
    2022-11-17T15:38:33.557+00:00

    Use Invoke-WebRequest and check the ResponseCode property in the object it returns. To reduce the overhead, and eliminate the sometimes parsing problems, use the -UseBasicParsing parameter.