Azure DevOps Repository
Azure Repositories offer a set of version control tools that help manage your code efficiently. Version control enables you to track changes made to the code over time, making it easier to collaborate with multiple developers. Azure DevOps supports two types of version control systems:
- Git: A distributed version control system where each developer has a complete local copy of the code repository.
- Team Foundation Version Control (TFVC): A centralized version control system where the code is stored in a single location.
Azure Repos Concepts
- Repository: A location for your code managed by version control, supporting both Git and TFVC. You can create multiple repositories within a single project and multiple branches for each repository.
- Branch: A lightweight reference that tracks changes. It isolates changes for features or bug fixes from the main branch (master).
- Branch Policies: These help protect critical branches (like master) by enforcing rules on how changes can be made to these branches.
- Pull and Clone:
- Clone: Create a complete local copy of an existing Git repository.
- Pull: Update your local repository with changes from the remote repository.
- Push and Commit:
- Commit: A set of changes saved to your local repository.
- Push: Share your committed changes to the remote repository.
- Fork: A complete copy of a repository, including all files and commits, allowing for independent development.
- Notification: Set up to receive email alerts for changes in work items, code reviews, pull requests, source control files, and builds.
- Projects: A workspace for teams to plan, track progress, and collaborate on software solutions.
- Teams: Subcategories of project members, helping to organize and focus work within a project.
Publishing an ARM Deployment Project into Azure DevOps
Step-by-Step Guide
- Create a New Project:
- Open Visual Studio and select Create a New Project.
- Select Azure Resource Group:
- Search for Azure Resource Group, select it, and click Next.
- Configure Your Project:
- Enter the project details and click Create.
- Select Web App Template:
- Choose the Web App from the available Azure templates in Visual Studio.
- Edit the
website.json
File:- Locate the
website.json
file in the left-hand side file explorer and click on it. - Remove the
appinsightcomponent
resource from the file (if it’s not needed).
- Locate the
- Add Solution to Source Control:
- Right-click on the solution and select Add Solution to Source Control.
- Confirm Repository Creation:
- A new Git repository will be created, confirmed by a message in the output window.
- Sync Changes:
- Click on Team Explorer, then right-click on the dropdown menu and select Sync.
- Publish Git Repository:
- Click on the Publish Git Repo button to publish the project to Azure DevOps.
- Select Project and Repository:
- Choose the project and repository where you want to push this Git repository in Azure DevOps and click Publish Repository.
- View Your Repository:
- Open the Azure DevOps portal and navigate to the organization you selected during publishing.
- Click on Repos to view the files.
- Check Branches:
- Click on Branches to see the branches associated with your repository. Initially, you will have only the default master branch.