Azure pipeline - How do I deploy code to Preregistered application

7/31/2019

Our devops team have created an application (ex:athena) and registered with AD. They also have given us Service Principle.

The question I have is , how do I deploy my code in GitHub to the application (athena) that the devops team created for me using the “Deploy to kubernetes service” configuration template ? Apologies in advance, as I am not proficient in Azure and this shows my gap in understanding.

The Information I have are :

  • Repository - GitHub (I have done the appropriate authorisation and can see the repository)
  • Service Principle (create by devops team)
  • Application (created by devops team)
  • I have created a Container Registry and Kubernetes service using azure portal

Now, I want to use the “Deploy to kubernetes service” configuration template.

Help much appreciated.

-- jack
azure-devops
azure-kubernetes

1 Answer

7/31/2019

If you want to use this Deploy to kubernetes service, you must get two service connection : Azure Resource Manager and Kubernetes Service Connection.

So, first, you need to configure the connection between Azure Kubernetes, ARM and Azure Devops. Enter project setting->service connection, open New Service Connection and select Kubernetes. Input the relevant configure according to your Azure:

enter image description here

And so do with Azure Resource Manager, you can follow this doc to configure it. Here is my ARM connection you can refer:

enter image description here

Then, you can begin your build and release pipeline.

Deploy to kubernetes service task used in release pipeline. In build pipeline, you must run docker build, push task to finish pushing to Azure registry Container.

And then, run this deploy task in release. You can refer to this blog which written by Azure DevOps Labs: Deploying a multi-container application to Azure Kubernetes Services. It has detailed steps you can refer.

In addition, there has two build source type. One is you import your github repos into Azure Devops repos. So the build can be trigger by Azure Devops Repos. And the other is select Github as your build source, in this type, you can triggered directly by your github instead of use Azure Devops repos:

enter image description here

And also, this need you get the service connection with your Github first. Then, authorize it during the build pipeline.

-- Merlin Liang - MSFT
Source: StackOverflow