DevOps Classroom Series (Evg) – 12/Dec/2021

Azure DevOps Pipeline for .net projects

  • Lets try to understand how to build a .net project
  • Create a windows 2016 server
  • Now Download Visual Studio build tools depending on which version your organization is using Refer Here
  • Install the build tools and git for windows
  • Install nuget cli using chocolatey choco install nuget.commandline
  • Restart the server
  • Refer Here for the sample dotnet code
  • Execute the following commands after launching visual studio Developer Command prompt
cd <project directory>
nuget restore WelcomeApplication.sln
msbuild -t:Rebuild -p:Configuration=Release WelcomeApplication.sln
  • Now lets create an Azure Pipeline for Asp.net Project
  • The Azure-Pipelines.yml looks as shown below
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4

trigger:
- main

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

Preview

  • Refer Here for the changeset containing azure pipelines for .net code

  • Refer Here for the articles which show how to build and release on different ecosystems

AWS CI CD Engine

Actvities

Next Steps:

  • Git Branching Strategy
  • Git Hub Pull Requests
  • Git Hooks/GitHub Webhooks
  • Git Submodules
  • GIt statsh
  • Git Tags

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Widget by Acurax Small Business Website Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube