Followers

Azure DevOps - Azure pipeline using Github

  Github repository also can be connected with the Azure pipeline. You need to auth Follow the below steps to connect the azure pipeline wit...

 Github repository also can be connected with the Azure pipeline. You need to auth

Follow the below steps to connect the azure pipeline with Github Repo.

1. Create an asp.net core project in VS [Visual Studio] ( You can use any programming language or any other IDE).

2. Add project solution in a local git repository. In VS, right-click on Solution and Add to source control, and provide the Github credentials and Repository name which you want to create in Github (say mySourceCode).

3. Repository should be created in your Github Account.

4. Login to Azure DevOps and click on Azure pipeline and click on Create Pipeline button.

5. Select Repository source as Github

6. Select the Repository mySourceCode.

7. Provide the Repository Access to the Azure pipeline for mySourceCode Repository by clicking on Approve and Install button.

8. Provide Azure DevOps credentials and select the organization and the project which you want to connect with the Azure pipeline.

9. Authorize Azure pipeline by Clicking on Authorize Azure Pipelines button.

10. Select the pipeline build platform (Aspnet core) .NET Framework

11. Write the pipeline code similar to the given below

# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
 
# Trigger indicates that whenever there is a change in the master branch then
# this pipeline will be executed automatically
trigger:
- master
 # VM image is windows latest
pool:
  vmImage: 'windows-latest'
 # variables are defined whichare used in the tasks
variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
 # job with multiple steps and steps are furhter having one or multiple tasks
 # NuGetToolInstaller@1 it is inbuilt step to download NuGet tool on the VM
 # NuGetToolInstaller@2 it is inbuilt step to Configure the NugetCommand for the solution (defined as variable)
 # VSBuild@1 to build the solution using MSBuild with given parameters
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:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

11. Save and run the pipeline.

Note: Saving will commit azure-pipelines.yml to the repository.




 

COMMENTS

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
ltr
item
DevOpsWorld: Azure DevOps - Azure pipeline using Github
Azure DevOps - Azure pipeline using Github
DevOpsWorld
https://www.devopsworld.co.in/2022/05/azure-devops-azure-pipeline-using-github.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/2022/05/azure-devops-azure-pipeline-using-github.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content