How to get the IP Address for Azure DevOps Hosted Agents to add to the white list

Gagan Jeet Singh picture Gagan Jeet Singh · Nov 22, 2018 · Viewed 14.1k times · Source

Is there a way to the IP address range for the hosted machine running?

This is related to the Release Pipeline -> Hosted agent.

Issue: Getting access denied on connection, as the connection is getting refused via Firewall. Need to whitelist the IP address range for this request coming from release pipeline on DevOps.

Answer

David Niwczyk picture David Niwczyk · Jan 9, 2019

I have a step in a release that gets the Hosted Agent IP address in powershell with:

Invoke-RestMethod http://ipinfo.io/json | Select -exp ip
Hope that helps.