求助:VSTS Deployment Group发布失败,目标服务器离线无法部署
Hey there, let’s work through this "target is offline" issue with your VSTS Deployment Groups—since it was running smoothly before the 6-week break, we can narrow down the common culprits that pop up after extended downtime.
1. First, Check the Deployment Agent Service on Your Local Test Server
Chances are the agent service stopped running while the server was inactive, or it didn’t start back up automatically:
- Open the Services console (press Win + R, type
services.mscand hit enter) - Look for the service named either
Azure Pipelines AgentorVisual Studio Team Foundation Background Job Agent(name depends on your agent version) - Make sure its status is Running and startup type is set to Automatic
- If it’s stopped, try starting it manually. If it fails to start, check the Event Viewer (under Windows Logs > Application) for specific error messages—this often points to permission issues or missing dependencies.
2. Validate the Agent’s Registration Status
Extended downtime can cause agent registrations to expire, or VSTS side configurations might have changed:
- Navigate to your agent’s installation directory on the test server (default is
C:\agentunless you chose a custom path) - Open a command prompt in that folder and run:
.\config.cmd status - If the output shows the agent is offline or unregistered, re-register it:
- Run
.\config.cmd removeto clear the old registration - Grab the fresh registration command from your VSTS Deployment Groups page (under "Add agent") and run it to re-link the server.
- Run
3. Confirm Network Connectivity to VSTS
Network rules often get updated during server downtime, blocking the agent’s connection:
- On the test server, ping
dev.azure.com(or your custom VSTS domain) to confirm basic connectivity - Check the server’s firewall settings to ensure outbound traffic on port 443 (HTTPS) is allowed to VSTS domains
- If your server uses a proxy to access the internet, verify the proxy settings are still valid: run
.\config.cmdand go through the setup prompts to check/update proxy details.
4. Check Agent Version Compatibility
VSTS rolls out updates regularly, and older agents might stop working after a few weeks:
- In your VSTS Deployment Groups dashboard, check the version of your offline agent
- Compare it to the latest agent version available for download (from the "Add agent" page)
- If there’s a big version gap, uninstall the old agent, download the latest package, and re-install + register it.
5. Rule Out System-Level Issues on the Test Server
Sometimes Windows updates or permission changes during downtime break things:
- Check if there are pending Windows updates that might have disrupted the agent service—install any pending updates and restart the server
- Confirm the account running the agent service (usually Local System, or a custom service account) has the necessary permissions: access to your deployment directories, read/write permissions for agent files, and network access to VSTS
- As a quick test, restart the entire test server—this fixes many transient service glitches that pop up after extended inactivity.
内容的提问来源于stack exchange,提问作者arame3333

