1

I'm deploying an asp.net core web app to various test servers whenever updated code is pushed. It works well.

I would however like to call an endpoint on the deployed web app after release to verify that all is indeed ok.

I've got the endpoint ready -- how do I active it from the release pipeline (preferably asserting a return code of 200 ok)?

(I'm usually at Stackoverflow, apologies if this is not an appropriate serverfault question!)

BR, Anders

Anders Juul
  • 173
  • 1
  • 1
  • 4

1 Answers1

0

You can use a Powershell Script task, with Script Type "Inline" and just Invoke-WebRequest -Uri http://<your-endpoint> because Invoke-WebRequest doc says (in example 7) :

When Invoke-WebRequest encounters a non-success HTTP message (404, 500, etc.), it returns no output and throws a terminating error. To catch the error and view the StatusCode you can enclose execution in a try/catch block.

If you don't tick the box "Continue on error" in your pipeline, the pipeline will stop if this Powershell task failed.

Swisstone
  • 6,357
  • 7
  • 21
  • 32