SDixit
SDixit

Reputation: 1

How to Identify the IP address when POSTMAN script is running in Azure

To run my POSTMAN test scripts I need to whitelist the IP address in azure web.config file. I want to add my test script in azure CI pipeline. How do I know the IP address when script running in Azure?

Upvotes: 0

Views: 4493

Answers (1)

Murray Foxcroft
Murray Foxcroft

Reputation: 13775

Unfortunately this is a bit convoluted. Hosted build agents can run on any one of a large range of IP addresses. What I do is use a PowerShell script to make a call to ipify to get the external IP address of the build agent. I then use PowerShell to call the Azure Management API to add this IP address to the firewall on the Azure app service (I use the App Service firewall, not the web.config). I then run what I need to in the CI build and tests and then call the management API to remove the IP address added.

Upvotes: 1

Related Questions