> ## 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.

## Authorizing Azure DevOps app

<Info>
  **Note**

  To integrate with Azure DevOps, you need an Azure DevOps user with `Basic` access level on the necessary AzureDevOps 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, please ask an administrator or a different user with those permissions to create the template.
</Info>

<Frame caption="Organization Settings - Basic Access Level">
  <img src="https://mintcdn.com/envzero-b61043c8/NFoAIaj_CGEzw-yg/images/guides/admin-guide/templates/organization_settings_-_basic_access_level.png?fit=max&auto=format&n=NFoAIaj_CGEzw-yg&q=85&s=9cc09372372eb046584a2b7b6693f500" alt="Organization Settings - Basic Access Level" width="3424" height="1148" data-path="images/guides/admin-guide/templates/organization_settings_-_basic_access_level.png" />
</Frame>

<Frame caption="Project Settings - View permissions for this node">
  <img src="https://mintcdn.com/envzero-b61043c8/NFoAIaj_CGEzw-yg/images/guides/admin-guide/templates/project_settings_-_view_permissions_for_this_node.png?fit=max&auto=format&n=NFoAIaj_CGEzw-yg&q=85&s=4ef63574f131b6904f1649c473f50e53" alt="Project Settings - View permissions for this node" width="1933" height="1029" data-path="images/guides/admin-guide/templates/project_settings_-_view_permissions_for_this_node.png" />
</Frame>

If the `env zero` Azure DevOps application has not been previously authorized, you will get a popup from Azure DevOps asking you to authorize it and to grant it repository access using your account.

<img src="https://mintcdn.com/envzero-b61043c8/NFoAIaj_CGEzw-yg/images/guides/admin-guide/templates/be8b39b-ado_access_request.png?fit=max&auto=format&n=NFoAIaj_CGEzw-yg&q=85&s=86b900d735fde22d7a3a0a9d8a4309c7" alt="Azure DevOps popup requesting authorization for the env zero app to access repository data" width="966" height="669" data-path="images/guides/admin-guide/templates/be8b39b-ado_access_request.png" />

## New Template

1. Click **ADD A NEW TEMPLATE** on the top right in the *Templates* screen.
2. Pick your template type, enter a name for the template, and click on **NEXT**
3. Click on the **Azure DevOps** button. Since you have already created an Azure DevOps template in this env zero organization, there is no need for further authentication with Azure DevOps.
4. Select the user to authenticate as out of the users in your organization that have already authorized the env zero Azure DevOps app. After selecting the user, you'll be able to choose a project from the list of accessible Azure DevOps Projects.
5. 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".
6. Enter the folder your `IaC` files are located in under `<IaC Type> Folder`. If your IaC files are in the root of the repository, leave this empty.
7. Click on **NEXT** to proceed to the variables section
8. Add environment and terraform variables that you'd like to be used during deployment, and then click on **NEXT** to go to the final "Projects" section
9. Pick the projects that you'd like to have access to deploy this template, and then click on **DONE** to create the template.

<Warning>
  Troubleshoot

  * Can't find your repository? Ensure that the Authorized User has access to the necessary Azure DevOps organization/project. In order to authorize a new Azure DevOps user, log out of Azure DevOps in your browser [here](https://aex.dev.azure.com/), and then click on "Authorize another Azure DevOps user."
  * Make sure to enable the `Third-party application access via OAuth` policy within your Azure DevOps organizations that you wish to integrate with env zero (Organization Settings -> Security -> Policies, See image below).
</Warning>

<img src="https://mintcdn.com/envzero-b61043c8/NFoAIaj_CGEzw-yg/images/guides/admin-guide/templates/8a2f4ae-turn_on_oauth.png?fit=max&auto=format&n=NFoAIaj_CGEzw-yg&q=85&s=c53a37a09db36b0447937357ad02c3b3" alt="Azure DevOps Organization Settings showing the Third-party application access via OAuth policy toggle" width="431" height="192" data-path="images/guides/admin-guide/templates/8a2f4ae-turn_on_oauth.png" />

<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.
