- A complete Dot Net Core Solution in Azure Repos
A. Create a Build Pipeline
- Go to Pipelines in the left pane of the Azure Devops Dashboard and click on create pipeline
2. Select Use the Classic editor option
3. Select the project, repo and branch for running the pipeline for and click continue
4. Select the appropriate template, for the project being demonstrated here it is .Net Core(.Net Framework) and click on apply
5. From the pipeline create goto Nuget restore and add the location of the nuget.config file if it pertains to your project
6. For testing and verifying build errors, save and queue the pipeline
7. Save and Queue
8. On the jobs, page click on the Agent Job 1
9. Wait for the job to complete, once completed you will get a notification that the build is successful, this will complete the CI part.
10. Edit the Pipeline and add triggers to run the pipeline on commits.
B. Prepare VM for Deployment
1. Create a Personal token which will be used to connect to your VM
2. Add in the basic details and expiration date, select custom scope and select Read and manage in the development groups
3. Copy and save the token generated.
4. Goto Development Groups in the pipelines menu
5. Create a new Deployment Group
6.Copy the script generated
7. Open your Azure VM and run the script in PowerShell
8. After this, it will ask for the Personal access token, paste the token we have saved in step 3 above
9. After it is a success a message similar to this will be displayed
10. Goto the targets tab in the Deployment groups, you will find the your VM listed there.
C. Prepare Release Pipeline for Deployment
Please make sure, IIS is installed and running in the VM
1. Goto release in the Pipeline menu
2. Create a new Release Pipeline
3. Select IIS Website Deployment
4. Click on Add artifact and select the Project and pipeline we created in STEP A.
5. Click on the trigger icon above the artifact. Enable continuous deployment trigger and select the repo branch
6. Click in 1 Job link in stage 1, in the IIS deployment tab select the deployment group we created in STEP B and save.
7. You can check the deployment location in the IIS Web app manage tab
8. Whenever there will be a commit the Build pipeline will be followed by a release pipeline and the application will be deployed in wwwroot folder of IIS