Azure DevOps doesn’t currently expose the authentication method (PAT vs SPN) used during agent registration via the UI, REST API, or CLI.
If you wanted to check then:
- Navigate to the directory where the agent is installed. This is typically something like C:\agent on Windows or /home/youruser/agent on Linux.
- Look for a file named .env or env in the agent directory. This file may contain environment variables that indicate whether a PAT or SPN is being used.
- Open the .agent file (JSON format). It contains metadata like the agent's name, pool, and URL—but not the auth method directly. However, if the agent was registered using a Service Principal, you’ll often find environment variables or scripts.
- Check the config.log file in the agent directory. It may include like:
- Using authentication type: PAT
- Using authentication type: SPN
- Run config.cmd (Windows) or ./config.sh (Linux/macOS) again. It will prompt for the authentication method. You can cancel after reviewing the current setup.
Hope this helps!
Please Let me know if you have any queries.