Azure Dev Tunnels
Everyday Open a local port to the internet behind a Microsoft-authenticated URL — for webhooks, client previews, and cross-device testing.Source of truth
Docs: learn.microsoft.com — dev tunnels
CLI reference: cli-commands
Status
Dev tunnels is in public preview — no SLA, and command names/options may still change. Fine for dev and demos, not for production traffic.
Install
# Windows
winget install Microsoft.devtunnel
winget upgrade Microsoft.devtunnel# macOS
brew install --cask devtunnel# Linux (and macOS script install)
curl -sL https://aka.ms/DevTunnelCliInstall | bashdevtunnel --versionLog in (required)
You cannot host anonymously — the host always authenticates, even if you later allow anonymous clients.
devtunnel user login # Microsoft / Entra ID account
devtunnel user login -g # GitHub account
devtunnel user login -d # device-code flow, no local browser
devtunnel user showHost a port
devtunnel host -p 3000Prints a public URL like https://TUNNELID-3000.usw2.devtunnels.ms/ plus an inspect URL for the traffic. Ctrl-C stops it — and a temporary tunnel is deleted on exit.
More shapes:
devtunnel host -p 3000 5000 # two ports at once
devtunnel host -p 8443 --protocol https # local server already speaks HTTPS
devtunnel host -p 8000 --expiration 2d # 1h … 30d
devtunnel host -p 3000 --allow-anonymous # no login for whoever opens itAnonymous access
Anyone on the internet who guesses the tunnel ID reaches your local server. Use it only for services that are safe to expose, and keep the expiration short.
Connect from the other side
Browser: open the printed URL and sign in with the same account (default is owner-only access).
CLI, to get the port back on localhost:
devtunnel connect TUNNELID
# → Forwarding from 127.0.0.1:3000 to host port 3000Persistent tunnels
A stable ID that survives restarts — useful when a webhook or a client bookmark points at it.
devtunnel create myTunnelID
devtunnel port create -p 3000 --protocol http
devtunnel host # hosts the last-used tunnel
devtunnel list
devtunnel show TUNNELID
devtunnel delete TUNNELIDAccess control
Share without going fully anonymous:
# time-boxed token for one person
devtunnel token TUNNELID --scopes connect
# anonymous, but only for 4 hours
devtunnel access create TUNNELID --anonymous --expiration 4h
# anonymous on one port only
devtunnel access create TUNNELID --port 3000 --anonymous
# whole Entra tenant / a GitHub org
devtunnel access create TUNNELID --tenant
devtunnel access create TUNNELID --org ORG
devtunnel access list TUNNELID
devtunnel access reset TUNNELIDGitHub org access needs the Dev Tunnels GitHub app installed in that org.
Diagnostics
devtunnel clusters --ping # nearest relay by latency
devtunnel echo http --port 8080 # local test server
devtunnel host -p 8080 --verboseRelated
- Remote access overview
- Tailscale — persistent mesh instead of a one-off URL
- Docker & hosting