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.
Thankfully, the Microsoft-hosted Build Agents have Internet access, and you can use a service such as http://ipinfo.io/ip to retrieve the Public IP Address of the Build Agent.
Azure DevOps import service During the import process, we highly recommend that you restrict access to your virtual machine (VM) to only IP addresses from Azure DevOps. To restrict access, allow only connections from the set of Azure DevOps IP addresses, which were involved in the collection database import process.
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.
Use a script step in the pipeline to get the current external ip and whitelist it. after pipeline finishes use another script step to clean up.
Thats the only way (for hosted agent), unfortunately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With