How to Deploy a Connector on Azure | Twingate

How to Deploy a Connector on Azure

Overview

There are several options available for deploying Connectors in Azure depending on your particular environment and needs. In most cases, you can use the Connector deployment page in the Admin Console to configure and deploy your Connector.

Check your subnet configuration

The subnet in which you deploy a Connector requires outbound Internet access, both to download the Connector container image and to connect to Twingate. Check our Best Practices for Connectors guide for more information.

Peer-to-peer connections help you to provide a better experience for your users and to stay within the Fair Use Policy for bandwidth consumption. Learn how to support peer-to-peer connections.

Azure Virtual Machine Deployment

If you are deploying a custom virtual machine, you can follow the general Linux Connector deployment instructions for full details.

In summary:

Please see our Connector Best Practices overview for general recommendations as well as hardware recommendations for Azure.

Azure Container Instance Deployment

We recommend using Azure’s Container Instance service to deploy Connectors. The Admin Console Connector provisioning workflow includes an Azure CLI deployment command that makes Connectors very easy to deploy.

Prerequisites

You will need the following information in order to deploy a Connector as a Container Instance on Azure:

Subnet selection for Container Instances

In most cases, Azure requires that Container Instances be deployed into their own subnet. We therefore recommend that you create a new subnet within an existing virtual network to ensure that Container Instance deployment will succeed.

If this is the first time that you have deployed a Container Instance in your Azure environment, you may also need to register the service in Azure. You can do this with the following command:

az provider register --namespace Microsoft.ContainerInstance

Twingate Connector Azure Container Instance Deployment

Docker Hub rate limiting

Docker Hub rate limiting can lead to the Azure Container Service throwing a RegistryErrorResponse error. When deploying a Connector using Azure Container Instances, we recommend using a Docker Hub account to bypass the default rate limits. To use your Docker Hub account, add the following parameters to the deployment command:

--registry-username "Docker Hub username" --registry-password "Docker Hub password" --registry-login-server index.docker.io

As an alternative to using a password, you may pass in a personal access token. If you sign into Docker Hub using SSO, e.g. Google or GitHub, you must pass in a PAT instead of a password.

Azure Kubernetes Service (AKS) Deployment

Connectors can also be deployed on an AKS cluster using the official Twingate Helm chart. If you intend use Twingate for K8s, you may also want to look at our Kubernetes Best Practices Guide.

Infrastructure as Code Deployment

Deployment automation is available using Terraform, Pulumi, or the Twingate API.

Don't re-use Connector tokens

Because tokens are specific to each running Connector, we recommend creating separate task definitions for each Connector instance you plan to run.

Updating the Connector

Updating Connectors running as a systemd service in a custom Azure VM can be done manually by using the Linux package manager, or automatically by setting up a scheduled task to check for updates. We recommend staggering updates across multiple Connectors to avoid downtime. For more details check our Systemd Connector Update Guide.

Connectors that are running in an Azure container can be upgraded through the Azure CLI. For more details check our Azure Connector Update Guide.