Sakthivel 16/05/2026 0
Have you ever tried deploying to an Azure resource hosted inside a private Virtual Network (VNet) and noticed that the deployment fails even though the Azure DevOps pipeline is configured correctly?
This is a common challenge in Enterprise environments.
Azure DevOps Microsoft-hosted agents (Windows or Ubuntu) are created dynamically by Microsoft during each pipeline execution. Since these agents use dynamic outbound IP addresses, we cannot reliably whitelist them in secure environments. As a result, deployments of private azure resources may fail. This issue is not limited to Azure Web Apps and can affect any Azure service hosted within a private network.
Create an Azure Virtual Machine inside the same VNet as the target Azure resources. This VM will act as the self-hosted Azure DevOps agent.
Use Azure Bastion to securely access the VM without exposing public RDP/SSH ports
Tip: Use Azure Bastion Standard Tier if file copy support is required. Basic tier does not support file transfer.
In the Azure DevOps, open the agent pool -> New Agent -> Select OS -> download the agent package. Copy the downloaded package to VM.
Example:
c:\agent
Open command prompt and navigate to the extracted folder.
C:\agent>config.cmd
Agent pool name: enterprise-self-hosted-agent
Open Azure DevOps and navigate to :
Azure Devops -> User Settings -> PAT
Create token with :
Agent Pools -> Read and Manage
Tip: You must have necessary privilege to generate token
Go to command prompt :
c:\agent and run : This command to manually start the agent. run.cmd .
Install as a windows service. This is to start the service automatically everytime when you restart the VM.
svc install
svc start
The VM must have access to all the dependencies, so, whitelist them.
Example:
Nuget packages
External Services
Navigate to :
Azure Devops -> Org Settings -> Agent Pools -> Create new agent pool
Give the pool name that you configured in the step “Configure the Agent”
Example: enterprise-self-hosted-agent
Nuget packages
External Services
Pool:
name: enterprise-self-hosted-agent
No comments found.