Azure DevOps Build Configuration - FH-Inway/d365fo.tools GitHub Wiki
Prerequisites
You will need a Personal Access Token configured in your github account. Read this guide to obtain that.
Configure Github Access
- Navigate to your Azure DevOps project
- Click on the "Project settings" icon in the bottom left corner of the page
images/image-e2513b65-f1db-4dad-a630-0e2ae6510eb9.png
- Select the "Service connections" menu option, under the "Pipelines" section in the new navigation tile on the left
- Select "Github" from the "New service connection" dropdown list
images/image-42be014d-3dab-49a4-827b-41ba6385b913.png
- Select the "Personal access token" option in the "Choose authorization" configuration
- Fill in a desired name for this connection that you are creating in the "Connection Name" configuration
- Fill in your token that you have created on Github in the "Token" configuration
images/image-99ecf271-0fbd-4b8d-9133-970992f628b2.png
- Validate that the "Service Connection" is created as desired and go back to your Azure DevOps project start page
Setup the build pipeline
- Select the "Pipelines" menu option in the navigation on the left
- Select the "Builds" menu option that is revealed under the "Pipelines" section in the navigation on the left
- Click the "+ New" iceon and select the "New build pipeline" from the dropdown
images/image-424819b5-687c-4b5d-8558-9953d7912ab1.png
Or if you never did create a build pipeline it will just show you a empty page with just one button to click
images/image-c3d3a98c-42bd-4864-b007-8402f94a8d10.png
- You have to select the "Github" option and validate that it selects the current "Service Connection" created earlier
- Select the github repository you want to build
- Select the default branch that the build pipeline should build when you initiate a manuel build
- "master" is the normal default
- Click continue when ready
images/image-b86b0ca1-9123-4e35-9d91-3079b9a70658.png
- Select the "Empty job" option in the very top of the page
images/image-7a660f10-5970-4246-bb0c-053e24c67689.png
- Select the new Agent job 1 and click on the + sign
- Search for PowerShell and add 2 x PowerShell tasks
images/image-00b1392f-9f4c-4b62-96d8-ba9e67a4e92d.png
- Search for Publish Test Results and add only 1
images/image-7cda2c2c-0276-45de-b48a-a250bfafe0b9.png
- Validate that you have 2 PowerShell tasks and 1 Publish Test Results
images/image-a520bea2-d107-4df4-9582-534e98563aaa.png
- Select the first PowerShell task, name it "Prerequisites"
- Fill in "build/vsts-prerequisites.ps1" into the "Script Path"
images/image-77dce872-0c56-440a-8103-5b1b1af5be05.png
- Select the second PowerShell task, name it "Validate"
- Fill in "build/vsts-validate.ps1" into the "Script Path"
images/image-7bfbab7d-5253-4ee5-8514-b3ff67e8364b.png
- Select the Publish Test Results and change the "Test result format" from "JUnit" to "NUnit"
- Expand the "Control Options" section and change the "Run this task" value from "Only when all previous tasks have succeeded" to "Even if a previous task has failed, even if the build was canceled"
images/image-a46e25f0-f4bd-446d-9942-97bcc614b4f4.png
- When ready click on the "Save & queue" button in the top menu and select the "Save" option from the dropdown menu
images/image-3c49f8ae-a868-46f7-8fa2-402e58cc341d.png
- Go back to the build pipeline overview and "Queue" a new build
- Accept the default values from the popup
images/image-9482e53d-e2fc-4129-894d-c6881a23358d.png
- Once the build is done and error free, you can continue the configuration of your github repository and branch protection