{"id":20697489,"url":"https://github.com/epomatti/az-ado-self-hosted-agent","last_synced_at":"2026-04-11T09:03:48.644Z","repository":{"id":184553383,"uuid":"672053387","full_name":"epomatti/az-ado-self-hosted-agent","owner":"epomatti","description":"Azure DevOps self-hosted agent deployment","archived":false,"fork":false,"pushed_at":"2023-10-04T00:23:28.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T18:36:24.680Z","etag":null,"topics":["ado","agent","azure","azure-devops","azure-vm","cicd","devops","docker","python","self-hosted","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epomatti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-28T19:50:19.000Z","updated_at":"2023-07-29T02:52:15.000Z","dependencies_parsed_at":"2023-07-29T00:24:23.855Z","dependency_job_id":"94a5c8bd-7571-48e9-97b8-1175c220d693","html_url":"https://github.com/epomatti/az-ado-self-hosted-agent","commit_stats":null,"previous_names":["epomatti/az-ado-self-hosted-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-ado-self-hosted-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-ado-self-hosted-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-ado-self-hosted-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-ado-self-hosted-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epomatti","download_url":"https://codeload.github.com/epomatti/az-ado-self-hosted-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242961747,"owners_count":20213315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ado","agent","azure","azure-devops","azure-vm","cicd","devops","docker","python","self-hosted","terraform"],"created_at":"2024-11-17T00:18:17.059Z","updated_at":"2026-04-11T09:03:48.639Z","avatar_url":"https://github.com/epomatti.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure DevOps Self-Hosted Agent\n\nDemo project for following the [documentation][1] for Linux.\n\n\u003cimg src=\".assets/self-hosted.png\" width=750 /\u003e\n\nCreate the server key pair:\n\n```sh\nmkdir -p .keys \u0026\u0026 ssh-keygen -f .keys/tmp_key\n```\n\nCreate the variables file and set the required variables:\n\n```sh\ncp config/template.tfvars .auto.tfvars\n```\n\nTo create the infrastructure:\n\n```sh\nterraform init\nterraform apply -auto-approve\n```\n\nOn Azure DevOps:\n\n1. Create a project\n2. Create a PAT with Agent Pools and Deployment permissions\n3. In Agent Pools, select the \"Default\" and Linux\n4. Follow the steps to install the agent\n5. Configure the agent as a service\n\nWhen completed, the agent will be online:\n\n\u003cimg src=\".assets/agent.png\" /\u003e\n\nCreate a pipeline based on the [`app/azure-hello.yaml`](app/azure-hello.yaml) file in this repo. It is set up to use a self-hosted agent.\n\nRun the pipeline.\n\n\u003e 💡 You'll need to give permissions to the pipeline\n\n## Docker build/push to ACR\n\nThe pipeline [`app/azure-acr.yaml`](app/azure-acr.yaml) will build and deploy to ACR.\n\nCreate a service connect for Docker Registry and select the option \"Others\". Create the \n\nNow create the pipeline that will build and push to ACR. Change the `containerRegistry` attribute as required.\n\n```yaml\nsteps:\n- task: Docker@2\n  inputs:\n    containerRegistry: 'acr-docker-others'\n    repository: 'myapp'\n    command: 'buildAndPush'\n    Dockerfile: '**/Dockerfile'\n```\n\n## Deploy to a VM environment\n\nFollowing the VM deploy environment [docs][3], create an environment called \"Production\".\n\nRegister the VM as a resource, like `vm-myapp-app`.\n\nCreate the pipeline referencing [`app/azure-deploy.yaml`](app/azure-deploy.yaml) with the `ACR_ADMIN_PASSWORD` secret.\n\nRun the pipeline to pull and run the previously built image.\n\n\u003cimg src=\".assets/deploy.png\" /\u003e\n\n\n## Develop the local Docker app\n\nTo check if the code in `app` directory is running:\n\n```\ndocker build -t hello .\ndocker run --rm -p 3333:3333 hello\n```\n\n## Using the Data Disk\n\nThe virtual machines are provisioned with an additional attached data disk.\n\nThis configuration can be utilized on the infrastructure components:\n\n- [Docker daemon](https://docs.docker.com/engine/daemon/)\n- [Azure DevOps Self-Hosted Agent](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/linux-agent?view=azure-devops\u0026tabs=IP-V4#commands)\n\n## Reference\n\n- [Example article][2]\n- [Azure Code Deploy][4]\n\n[1]: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/linux-agent?view=azure-devops\n[2]: https://medium.com/@cocci.g/set-up-an-azure-devops-self-hosted-agent-5cd9b009b509\n[3]: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/environments-virtual-machines?view=azure-devops\n[4]: https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/deploy-linux-vm?view=azure-devops\u0026tabs=javascript\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Faz-ado-self-hosted-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepomatti%2Faz-ado-self-hosted-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Faz-ado-self-hosted-agent/lists"}