DevOps Classroom Series – 07/Mar/2021

Configuring self-hosted agents on Azure DevOps

  • Create a new agent pool for linux agents Preview

  • Now create a ubuntu vm Preview

  • Setting upd An access token for agent communication Preview Preview

  • Configure the agent and install the necessary softwares

    • jdk 8
    • maven
  • run the agent and check if the agent is online Preview Preview

  • Now lets create azure pipeline to build the java project spring petclinic, so first lets create the repository for it

  • Now lets use the schema Refer Here to create a azure-pipelines.yaml file to build this maven project

  • Refer Here for all the tasks

  • Lets setup one project for Asp.net the azure-pipelines.yaml is 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:
- master

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)'

  • To setup msbuild environment, create a windows vm and install visual studio build tools. Navigate to Refer Here and download visual studio build tools Preview
  • To try to use azure devops across different ecosystem Refer Here

Leave a Reply

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

About learningthoughtsadmin