Azure DevOps Integration

Authorizing Azure DevOps app

📘

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

Organization Settings - Basic Access Level

Organization Settings - Basic Access Level

Project Settings - View permissions for this node

Project Settings - View permissions for this node

If the env0 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.

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

🚧

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, 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 env0 (Organization Settings -> Security -> Policies, See image below).

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

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.

📝

Additional Content