Configure Source Control with Azure Repos
Learn how to implement Source Control with Azure Repos.
With Source Control with Azure Repos, you can use pull requests on Azure Repos to manage changes to your Retool applications.
Setup instructions
Disable git syncing
If you've enabled Git Syncing, disable it:
- In your
docker.env
file, setDISABLE_GIT_SYNCING=true
andVERSION_CONTROL_LOCKED=false
. - In the Settings > Advanced tab in Retool, remove the repository URL and branch name from your Git Syncing configuration.
Prerequisites
This guide requires access to an Azure DevOps account with permissions to create repos and access tokens.
1. Create a new repository in Azure Repos
- Create or use an existing project under Azure Repos. Ensure its name does not contain any spaces.
- Create a new Git repository under Azure Repos for your Retool apps. Ensure that it has a
README.md
file at the root level directory.
2. Create a personal access token
- Create an Azure Repos personal access token.
- Under the Code section, check Full and Status. With this token, Retool will be able to programmatically manipulate your repository, generate pull requests, and see their statuses. Accordingly, use the most appropriate admin in your organization to generate it.
3. Configure Azure repository settings
- Retool Cloud and Self-hosted Retool v3.18 and later
- Self-hosted Retool v.2.115.1 and later
Go to the Source Control settings, and select Set up Azure Repos. Enter the following settings.
Setting | Description | Example |
---|---|---|
Azure Repository | The repo name from step 1. Ensure this name does not contain any spaces. | retool-apps |
Azure Organization | The Azure DevOps organization. | acme-co |
Azure Branch | Retool automatically tracks changes to this branch. | main |
Azure Project | The new or existing Azure DevOps project from step 1. Ensure its name does not contain any spaces. | proj-retool |
Azure User | The Azure Repos username. | retool |
Azure URL | Your base Azure URL. For Azure Cloud, this is always http://dev.azure.com. For Azure self-managed, this is the URL where your instance is hosted. | https://azure.mycompany.com |
Personal Access Token | The Azure project access tokens to authenticate to the Azure API. | AKIAWS3BACWHP6QW6VB2 |
Use Basic Auth | Set this to true if you are using self-hosted Azure Repos. | true |
Variable | Description | Example |
---|---|---|
AZURE_REPOS_USER | The Azure Repos username | retool |
AZURE_REPOS_PERSONAL_ACCESS_TOKEN | The personal access token generated previously | mpoqd2zy7jklzfbhmuzev46vbbcpkeeqminb4wcvwigsrldasdfa |
AZURE_REPOS_ORGANIZATION | The Azure DevOps organization | acme-co |
AZURE_REPOS_PROJECT | The new or existing Azure DevOps project from step 1. Ensure its name does not contain any spaces. | proj-retool |
AZURE_REPOS_REPO | The repo name from step 1. Ensure its name does not contain any spaces. | retool |
AZURE_REPOS_MAIN_BRANCH | Retool automatically tracks changes to this branch | main |
If you use your own SSL certificates, set the SSL_CERT_FILE
and NODE_EXTRA_CA_CERTS
environment variables on the jobs-runner
and api
containers to the path to your SSL certificate.
4. Test your configuration
After you set up your environment variables, if you’re an admin on your Retool instance, you can visit Settings > Source Control.
If your Azure Repos environment is correctly configured, the page will show your Azure Repos commits in the Deployment Dashboard section. You can also click the Test connection button, which sends a request to test the connection.
If you don't see the Deployment Dashboard and your Azure Repos commits on Settings > Source Control, check that your environment variables are correctly configured.
What's next?
You are now ready to use source control. Learn how to create branches and pull requests, merge changes, and use other source control features in the getting started guide.