Configure Source Control with Azure Repos
Source Control with Azure Repos is available on on-premise deployments of Self-hosted Retool v2.115.1 or later.
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.
- 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 programatically manipulate your repository, generate pull requests, and see their statuses. Accordingly, use the most appropriate admin in your organization to generate it.
3. Set up environment variables on your Retool instance
Set the following environment variables on your Retool instance on the api
and jobs-runner
containers.
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 | proj-retool |
AZURE_REPOS_REPO | The repo name from step 1 | 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.