Azure DevOps for the open Source Projects

Azure DevOps for the open Source Projects presented at .netlocal Conf Bangalore.

Azure DevOps for the Open Source Projects

 

Azure DevOps Allows you to build on any platform and with any language. Let’s see how we can create a CI/CD pipeline for .netcore application with github.

  • Open Visual Studio -> File -> New ->Project.

  • Select .NetCore Under Visual C# section and select the Asp.NetCore Application.

 

  • Select the WebAPI template.

 

  • Publish the code to github by using the steps mentioned​​ here.

 

  • Go to dev.azure.com and create a new project.

 

  • Click on Pipelines and then Build from the submenu

 

  • Click on use the visual designer link to use the build templates and select the approporiate template. For this demo, we will use the ASP.Net Core template​​ 

 

  • Select the appropriate source repository to build the code. As our code is resided in the github, we have selected github and selected our repository AzureDevops Test.

 

 

  • Once the configuration is done, the template will be ready to run. Depending upon the​​ templates the appropriate tasks will be added to the build pipeline. For .Net Core Application, we will have 4 major tasks.​​ 

  • Restore Solution : it’s use to restore the dependencies through the nugget ​​ package manager restore.

  • Build Solution : It will build the solution and generates the binaries

  • Test Assemblies : It will take your unit test and run it on the solution

  • Publish Artifacts: The artifacts generated after the build will be published so that it can be used​​ for​​ deployment. ​​​​ 

 

  • Click on the save button and once the popup appears select the branch and the agent type where you want to build your code.​​ We selected Hosted VS2017 machine to build our code.

 

 

  • Once triggered, you will see that the build is queued.

 

  • Click on the queued build and see the pipeline running.

 

  • Once the Build is generated, click on artifacts​​ ​​ Drop. Our artifacts are going to be stored in the drop folder.

  • Select the WebApp.Zip that needs to be deployed.​​ 

 

 

  • As we are done with the CI part of it, let’s configure the pipeline for CD. Click on the release button.

 

  • Artifacts generated from the build step will be available for deployment. Now we are going to​​ publish the application to Azure App Service Deployment Template by clicking on the select a template button on stage 1 deployment.

  • Click on 1 Job to configure the job.

 

  • Click on the Stage 1 and create a connection to your azure subscription. Select the Web App in the app type and select the app service name where you want to publish. For this step, you have to make sure the app service already exists in your subscription. Check here to understand that how to​​ create an app service.

  • Set the path of the Package as ${Syste./DefaultWorkingDirectory)/**/*.zip to select the zip file.

 

 

 

  • Click on the create button to complete the release pipeline.

 

  • Deployment will be started and you can monitor the progress.

 

  • Once the deployment is completed, Check the application by hitting the URL. We took​​ 

 

 

 

 

 

 

 

 

Comments

comments

Leave a Reply

Your email address will not be published.