Azure DevOps Repos (Azure Repos) facilitates developer collaboration, by allowing you to host your own fully managed Git repository within Azure. Within this hands-on lab, we’ll look at how you can setup your own Azure Repo, and use Visual Studio Code to commit changes.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Get Started with Azure DevOps
- Login at the Azure DevOps Portal.
- Follow the Getting Started wizard, and create a project called
Lab Project
(private visibility). - Create and Initialize new Repo called
IT Ops Repo
(tick the box to include a README.md file).
- Get Started with VS Code
Connect to the VM (Optional)
- Connect to the VM using RDP (the public IP is provided for you for VM1, on the lab instructions page).
- Log in using the credentials provided for you.
Note: This step is entirely optional, as you can run this on your own PC if desired, rather than connecting to the VM. You can refer to this Microsoft article for more information on using an RDP client.
Get Started with Visual Studio Code
- Open Visual Studio Code.
- Start a new terminal in Visual Studio Code and set up your identity (see the ‘Your Identity’ section in this article for more information) on how to use
git config --global user.name
andgit config --global user.email
.
- Clone the Repository in VS Code
- Navigate to the
IT Ops
repo we created earlier within Azure DevOps Repos. - Retrieve the repository HTTPS URL (through the Clone Repository button).
- Navigate back to Visual Studio Code, and clone the repo using the details you captured above, authenticating with your lab credentials (see this Microsoft article for more details about using Git).
- Navigate to the
- Commit Changes
- Open the repo within Visual Studio Code when prompted to do so (after cloning the repo in the previous objective).
- Make changes to the
README.md
file. - Commit the changes locally with a comment.
- Push/sync the changes to Azure DevOps.
Note: You can now go back to the Azure DevOps Repo and refresh the page. You should see the updated changes to
README.md
and be able to view its history.