Azure DevOps -- using Docker-Compose task to deploy to Azure Container Instances - azure

I am trying to create a CI/CD pipeline for a multi-container solution implemented via docker-compose.yml. The goal is to run a container group in Azure Container Instances.
I went with this task DockerCompose#0 for the release pipeline, and the steps to build containers and to deploy them to Azure Container Registry are straighforward.
But, I cannot figure out if it's possible to configure this task to deploy and run containers in ACI. There is an option to Run the Images, but the images are run on the agent's docker host:
How do I instruct this task that the containers to be run in ACI? I know there is a way to do that via Docker CLI with a step to connect to the ACI context, but I can't figure out how to switch to the ACI context from the DevOps pipeline.

How do I instruct this task that the containers to be run in ACI?
Ans:
The new release pipeline needs to start with an empty job and provide a name for the release definition. Next, we need to add artefacts to our application. Since all we want to deploy is a Docker image located in the ACR, select the artefact type as the Azure Container Registry (ACR).
Here is the blog tutorial to Configure CI/CD for Azure Container Instances using Azure / Azure DevOps Pipelines given by #mohitgoyal.

Related

Use Running Azure Container Instance in Azure Pipeline

I'm currently using resource: container in azure pipeline to pull my custom image tools from ACR, and use this image to create a container than can run several CLI commands on my pipeline.
Pulling this custom image tools takes so much time, roughly around 5mins and I want to avoid that as it is considered as a wasted time and a blockage since I do debugging most of the time.
Question: Is it possible to create an Azure Container Instance that constantly run my custom image tools then call this container inside my pipeline to run some cli commands?
I'm having a hard time finding documentation, so I'm not really sure if it is possible.
You can try to set up a self-hosted agent in your custom Docker image, and when running the container on ACI, it will install the agent and connect it to your Azure DevOps.
Then, you can use this self-hosted agent to run your pipeline job which needs to run the CLI commands. Since the self-hosted agent is hosted in the container, the job runs on the self-hosted agent will run in the container.
About how to configure set up self-hosted agent in Docker image, you can reference the document "Run a self-hosted agent in Docker".

How to create Azure pipeline CICD for docker container to linux on premises server?

I have a containerized app's image that builds on master push and ends up in azure container registry. I need to setup the next step where this image ends up on my linux on prem server.
I have established the connection with the server using a deployment group agent, which claims is healthy.
I have created a pipeline which takes the built image artifact as input but I am completely failing to grasp and create the step in which the artifact is being pulled on / pushed to the server (and ideally run too).
I am looking at the tasks in the pipelines > task section in Azure Devops but I cannot find a place to add some specific steps neither I am very sure what steps to add.
I would very much appreciate any tip on how to deploy a container from acr to on premises linux server using azure devops pipelines. Thank you in advance.
You can check this link which shows how to create Azure Pipeline CI/CD for docker container ,make sure all these steps are followed:
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops

Deploy ShinyProxy and an application with Azure DevOps

I'm trying to deploy a ShinyProxy in a Docker container to Azure. Also, I have the ShinyApp repositories in Azure DevOps. Every time a developer updates the code in a repository, I want to the CD/CI deploy the new code creating a Docker container to Azure.
Also, I think, I have to create an internal Docker network between the ShinyProxy and the app.
How can I create this process? Is there any tutorial how to setup a pipeline in Azure DevOps and run a ShinyProxy on Azure?
After a lot of research and study, I found how to create a full end-to-end deployment. I have created a complete step-by-step guide in my blog.
I hope it could help other guys.
Do you want to deploy your app to Azure Container Registry?
If so, below are the main steps you need to do:
Create a container registry on the Azure Portal.
Create a Docker registry service connection on the project settings to enable your pipeline to push images into the container registry.
Create the pipeline that gets source from your repository.
Add the Docker task in the pipeline,
select the Docker registry service connection created in above step as the 'Container registry'.
select 'buildAndPush' as the 'command'.
To view more details, you can reference to "Build and push to Azure Container Registry".

Azure DevOps - on prem deployment pipeline

I am going to create CI/CD pipeline in Azure DevOps for .Net core web app.
I need to have below procedure:
CI : Visual Studio -> Azure repo -> Build on hosted agent -> create a Docker image and push it to Azure container registry
CD: Deploy created image to on-prem docker swarm cluster
Now, I have 2 questions:
1- how can I deploy to docker swarm cluster
2- I have to deploy directly from build agent to swarm cluster without internet access.
I would appreciate if you can help me.
For your requirement, I'd suggest that you could setup a private agent for Release Pipeline (CD) to deploy created image to on-prem docker swarm cluster.
For CI pipeline, you could use Microsoft Hosted agent.
Regarding that private agent, it should able to connect to internet, but you could restrict it just can connect to Azure DevOps by adding white-list: Allowed address lists and network connections
Regarding deploy to on-prem docker swarm cluster, you could call command through Command Line task.
Deploy a stack to a swarm
Apply rolling updates to a service

Create a pipeline on azure devops to deploy a docker container on azure app service?

I have a docker image in my Azure Container Registry and a Web App For Containers(Linux). Now, I want to create a release pipeline which should be able to deploy that container for Azure Container Registry to Web App For Container. I know I can do this manually but I need to Automate this process through Azure DevOps.
I was trying to make a release pipeline to deploy docker image on Azure web app for container and I made that pipeline by following this tutorial.
https://learn.microsoft.com/en-us/azure/devops/pipelines/apps/cd/deploy-docker-webapp?view=azdevops&viewFallbackFrom=vsts
I hope this can help others as well. Thank you

Resources