Demo project for following the documentation for Linux.
To create the infrastructure:
terraform init
terraform apply -auto-approve
On Azure DevOps:
- Create a project
- Create a PAT with Agent Pools and Deployment permissions
- In Agent Pools, select the "Default" and Linux
- Follow the steps to install the agent
- Configure the agent as a service
When completed, the agent will be online:
Create a pipeline based on the app/azure-hello.yaml
file in this repo. It is set up to use a self-hosted agent.
Run the pipeline.
๐ก You'll need to give permissions to the pipeline
The pipeline app/azure-acr.yaml
will build and deploy to ACR.
Create a service connect for Docker Registry and select the option "Others". Create the
Now create the pipeline that will build and push to ACR. Change the containerRegistry
attribute as required.
steps:
- task: Docker@2
inputs:
containerRegistry: 'acr-docker-others'
repository: 'myapp'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
Following the VM deploy environment docs, create an environment called "Production".
Register the VM as a resource, like vm-myapp-app
.
Create the pipeline referencing app/azure-deploy.yaml
with the ACR_ADMIN_PASSWORD
secret.
Run the pipeline to pull and run the previously built image.
To check if the code in app
directory is running:
docker build -t hello .
docker run --rm -p 3333:3333 hello