Thursday, February 28, 2019

CI CD using Azure Devops



To set up a build in Azure devops:

1)    Go to pipelinesà builds



2)    Click on new à new build pipeline
3)    Using the built-in pipelines:
a.     Select the repository type (in EY, it is usually azure repos)
b.     Select the repository
c.     In configure tab, select the pipeline task (.net core, asp.net etc etc)
4)    If you want to configure a custom pipeline:
a.     Select “use the Visual Designer”


b.     Select the repository, source and branch (selecting master branch for builds is the recommended approach)
c.     Click on continue
d.     Pre-existing templates will be displayed. You can select any of these templates (as needed) or select an empty job.


5)    To add individual tasks / activities:
a.     Go to the build pipeline and click on the “+” icon




b.     List of tasks will be displayed.
c.     Add suitable tasks. Usually for .net projects the tasks will be restore, build, test and publish.
d.     “publish artifact” creates zip files with binaries for each project. (this will be useful for deployment as well)
e.     Click on “save and queue”, the build will start. After completion of the build, an email is sent.
f.      To view the build artifacts click on view results in the email.
g.     In the page that is displayed, select artifacts

h.     Given below is a snapshot of asp.net core app.



i.      In the agent job, select “hosted VS 2017” if using VS 2017







To set up a release
1)      Click on pipelines à releases à new release pipeline
2)      In the templates select “azure app service deployment”


3)      A new stage is created. The release pipeline can be split into multiple stages.




4)      In the artifacts, click on add an artifact,

5)      Select source type as build, select the project and also the build pipeline
6)      Click on 1 job,1 task link



7)      Select azure subscription and app service name
8)      In the deploy azure App service task, enter the package or folder details (the zip file from the build artifacts)


9)      Go to application settings and configuration settings to add any app settings



10)  Save and click on release.
11)  The application is deployed to the azure app service.

No comments:

Post a Comment