This example shows setting up a Tailscale exit node running as a container on Azure Container Instances to provide global Internet egress. You can also use a similar setup to configure a Tailscale subnet router which would allow access to Azure private Virtual Networks, private endpoints, private DNS zone resolution as well as Azure service endpoints.
You can use exit nodes on several platforms including Android, iOS, Linux, macOS, tvOS and Windows.
Warning
Using an exit node will tunnel all your traffic through the selected Azure region. This might trigger certain security controls such as Entra ID protection impossible travel.
Note
This deployment uses a Microsoft Artifact Registry published Azure Linux image with a scripted installation of Tailscale. This is done instead of using the ready Tailscale image published on Docker Hub due to Docker anonymous uage limits.
Sign-up for a free Tailscale personal plan. The free plan supports up to 3 users and 100 devices.
Define a Tailscale ACL policy in the access controls section of the admin portal:
{
"tagOwners": {
"tag:exitnode": [],
},
"autoApprovers": {
"exitNode": ["tag:exitnode"],
},
"acls": [
{
"action": "accept",
"src": ["*"],
"dst": ["*:*"],
},
],
}
Create a Tailscale OAuth client in the OAuth clients settings section of the admin portal. Configure the OAuth client as follows:
- Description a descriptive name e.g.
Azure VPN
- Scope Keys -> Auth Keys -> Write (
auth_keys
) with the assigned tagtag:exitnode
. This allows the OAuth client to exchange the client secret for an authentication key to register the node with using OAuth credentials. - Scope Devices -> Core -> Write (
devices:core
) with the assigned tagtag:exitnode
. This allows the OAuth client to register and auto approve itself as a device.
After creation of the client you will be shown a client ID and client secret. The client secret is of the form tskey-client-<clientid>-<secret>
. You will need the client secret for the tailscaleClientSecret
deployment parameter in the next step.
Deploy the Bicep azure-vpn.bicep or click the button below to deploy the compiled ARM template azure-vpn.json. Configure parameters:
Region
not really relevant, this is the region for your resource group metadataLocation
which region to deploy the Azure Container Instance to serve as the VPN exit nodeTailscale Client Secret
the OAuth client secret from the previous stepTailscale Tag
can be left astag:exitnode
if you did not change this in the earlier configuration steps
Tip
Repeat with different Location
values to deploy exit nodes at different Azure regions around the world.
An example with various regions deployed:
You can use the exit node by selecting the Tailscale icon and navigating to Use exit node then selecting the name of the exit node device.
Performing an IP lookup when connected to the Azure East Japan region:
- Stop and delete the Azure Container Instances.
- Ensure exit node devices are deregistered in the Tailscale admin machines listing.
- If desired revoke the OAuth client.