> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure DevOps Integration

> Connect Azure DevOps repositories to env zero for IaC template creation, requiring Basic access level and View permissions for the organization.

<Warning>
  To integrate with Azure DevOps, you need an Azure DevOps user with `Basic` access level on the necessary Azure DevOps organization and `View permissions for this node` permission for the project. We recommend that this user be a designated shared bot user, as env zero will perform actions as this user on the project/repository.

  If you do not have the correct permissions, ask an administrator or a different user with those permissions to create the template.
</Warning>

## Prerequisites

Before creating an Azure DevOps template, you need an Azure DevOps VCS connection configured in your organization. To set one up, go to **Organization Settings > VCS** and create a new Azure DevOps connection.

Learn more: [Managing VCS Connections](/guides/admin-guide/manage-vcs#centralized-management)

## New Template

<Steps>
  <Step title="Create Template">
    Click **ADD A NEW TEMPLATE** on the top right in the *Templates* screen. Pick your template type, enter a name for the template, and click **NEXT**.
  </Step>

  <Step title="Select Azure DevOps">
    Click on the **Azure DevOps** button.
  </Step>

  <Step title="Select VCS Connection">
    Select a pre-configured Azure DevOps VCS connection from the dropdown. If no connection exists, click **Add VCS Connection** to create one.
  </Step>

  <Step title="Select Repository">
    Pick the repository from the list of accessible Azure DevOps projects.
  </Step>

  <Step title="Configure Source">
    If you would like to pull the code from a specific revision or branch, enter that in the `Branch` field. Leaving this field empty will use your default branch, which is usually "master"/"main".

    Enter the folder your IaC files are located in under the IaC type folder. If your IaC files are in the root of the repository, leave this empty.
  </Step>

  <Step title="Configure Variables">
    Click **NEXT** to proceed to the variables section. Add environment and Terraform variables that you'd like to be used during deployment, and then click **NEXT** to go to the final "Projects" section.
  </Step>

  <Step title="Assign Projects">
    Pick the projects that you'd like to have access to deploy this template, and then click **DONE** to create the template.
  </Step>
</Steps>

<Warning>
  Troubleshoot

  * Can't find your repository? Verify that the VCS connection has access to the necessary Azure DevOps organization/project. You can check the available repositories in **Organization Settings > VCS** by selecting the relevant connection.
</Warning>

<Warning>
  **Azure DevOps old domain name URLs**

  Repositories using the old domain name URLs are not supported, i.e., if the URL for your git repository is in the format of `<organization-name>.visualstudio...` an environment won't be created.

  For more information about old domain name URLs and how to resolve the issue, read [here](https://learn.microsoft.com/en-us/azure/devops/release-notes/2018/sep-10-azure-devops-launch#switch-existing-organizations-to-use-the-new-domain-name-url).
</Warning>

## Existing Template

If you would like to integrate an existing template with Azure DevOps:

1. From the **Templates** screen, click on **Settings** for the appropriate template you would like to integrate with Azure DevOps.
2. Click on the **VCS** step. From there you can click on the **Azure DevOps** button, and integrate with Azure DevOps as you would for a new template.

<Info>
  Additional Content

  * [Managing Terraform variable hierarchy](https://www.env0.com/blog/managing-terraform-variable-hierarchy)
  * [Why env zero is a Terraform Cloud alternative?](https://www.env0.com/alternatives/terraform-cloud-alternative)
</Info>

## Next steps

* [Managing VCS](/guides/admin-guide/manage-vcs) - Manage all VCS provider connections in one place.
* [Standard GitHub Integration](/guides/admin-guide/templates/github-templates) - Connect GitHub as an alternative VCS provider.
* [Running Plan on Pull Requests](/guides/admin-guide/environments/plan-on-pull-request) - Trigger plans automatically from pull requests.
* [Template Overview](/guides/admin-guide/templates) - Learn how templates are structured and configured.
