DevOps

Azure DevOps Repos & Git: Best practices for teams

December 3, 2025
Sabhat Qureshi
11 min read

Why Azure Repos?

Azure Repos provides Git repositories hosted in Azure DevOps, offering enterprise-grade security, integration with Azure Boards and Pipelines, and powerful collaboration features for software development teams. Azure Repos.

Azure Repos features

  • Unlimited private repos included with Azure DevOps
  • Branch policies for protected branches
  • Pull requests with code review workflows
  • Integration with work items and CI/CD pipelines
  • Advanced security and access controls

Branching strategies

Git flow

Traditional branching model with develop, feature, release, and hotfix branches. Best for scheduled releases.

main (production)
  │
  ├── hotfix/urgent-fix ──→ (merge to main and develop)
  │
develop (integration)
  │
  ├── feature/user-story-123 ──→ (merge to develop)
  ├── feature/user-story-456 ──→ (merge to develop)
  │
  └── release/1.0 ──→ (merge to main, tag, merge back to develop)

GitHub flow

Simplified model with main branch and short-lived feature branches. Best for continuous deployment.

main (always deployable)
  │
  ├── feature/add-validation ──→ PR → merge → deploy
  ├── bugfix/fix-calculation ──→ PR → merge → deploy
  └── feature/new-report ──→ PR → merge → deploy

Release flow (Microsoft's approach)

Microsoft's strategy combining topic branches with release branches for production-ready code.

Branch policies

Protect important branches with policies:

  • Require pull requests: No direct commits to protected branches
  • Required reviewers: Minimum number of approvers
  • Build validation: CI build must pass before merge
  • Linked work items: PRs must reference work items
  • Comment resolution: All comments must be resolved

Pull request best practices

Creating effective PRs

  • Keep PRs small and focused (under 400 lines)
  • Write descriptive titles and descriptions
  • Include screenshots for UI changes
  • Reference related work items

Code review guidelines

  • Review for correctness, maintainability, and security
  • Be constructive and specific in feedback
  • Use 'suggest changes' for specific recommendations
  • Approve only when comfortable with all changes

Git commands for daily work

Common workflows

  • Feature development: Create branch, commit, push, PR
  • Bug fixes: Branch from main, fix, merge back
  • Hotfixes: Branch from production tag, emergency fix

Commit message format

Use conventional commits: type(scope): description

# Format: <type>(<scope>): <description>

# Types:
feat:     New feature
fix:      Bug fix
refactor: Code refactoring
docs:     Documentation
test:     Adding tests
chore:    Maintenance tasks

# Examples:
feat(account): Add email validation to contact form
fix(pricing): Correct calculation for discounts
refactor(plugin): Extract validation to service class

Dynamics 365 source control

Repository structure

  • /solutions - unpacked solution components
  • /plugins - plugin source code
  • /webresources - JavaScript, CSS, HTML files
  • /scripts - build and deployment scripts
  • /pipelines - Azure Pipeline YAML files

.gitignore for Dynamics 365

Exclude build outputs, connection files, and solution package files

Security best practices

Repository security

  • Use Microsoft Entra ID for authentication
  • Implement least-privilege access
  • Enable branch policies for protection
  • Audit access and changes regularly

Managing sensitive data

  • Never commit secrets or connection strings
  • Use .gitignore for local config files
  • Use Azure Key Vault for secrets
  • Scan repos for accidentally committed secrets

Team collaboration

Code owners

Define CODEOWNERS file to automatically assign reviewers based on file paths.

Documentation

  • Include README.md in each major folder
  • Document branching strategy and conventions
  • Keep wiki updated with architecture decisions

Conclusion

Effective source control practices are fundamental to successful Dynamics 365 development. Azure Repos provides the tools needed for professional Git workflows, from branch policies and pull requests to integration with Azure Pipelines. Establish clear branching strategies, enforce code review, and automate your deployment pipeline for reliable, repeatable releases.

Need help with your Dynamics 365 project?

I can help you apply these practices in your own Dynamics 365 environment.