Version of your agent? 2.149.2
OS of the machine running the agent? Linux
dev.azure.com (formerly visualstudio.com)
With the latest agent release I am looking into using the run once flag (--once) to tear down our agent containers after they have completed a job. This is working correctly in terms of running but after the container has been stopped the offline agent still remains in the pool. I expected that it would execute it's normal stop procedure which involves removing itself from the agent pool. Is this by design or is it perhaps a bug in the run once functionality?
@EwanNoble remove agent from pool (Unconfigure) requires admin privilege. the behavior you saw is by designed since --once don't have any credential from you. :)
Hi @TingluoHuang, thanks for the response. The admin credentials would be available to the service at this point as they are used for configuration, would there be scope for a feature to provide the 'run once' agent to access those credentials if available?
@EwanNoble we don't have feature for that yet, but i think you can do it yourself.
Dockerfile:
CMD "config.sh && run.sh --once && config.sh remove"
@TingluoHuang that makes a lot of sense and it worked perfectly! Thanks for your help. 馃槉
cool, i am going to close this issue, please reopen if you need more help. :)
Most helpful comment
cool, i am going to close this issue, please reopen if you need more help. :)