Copy your local developer credentials to a new azlin VM so tools work immediately after creation.
- azlin installed and authenticated with Azure (
az login) - At least one supported credential source on your local machine:
- GitHub CLI (
gh auth logincompleted) - Azure CLI (
az logincompleted) - GitHub Copilot CLI configured
- Claude Code configured
- GitHub CLI (
Credential forwarding runs automatically after VM creation. Confirm each credential individually:
azlin new --name devboxOutput:
Creating VM devbox in eastus2...
✓ VM created (Standard_D4ds_v5)
✓ Waiting for SSH... ready (18s)
Found credentials:
• GitHub CLI (~/.config/gh)
• Azure CLI (~/.azure)
Forward GitHub CLI credentials? [y/N] y
✓ Copied ~/.config/gh → devbox:~/.config/gh
Forward Azure CLI credentials? [y/N] y
✓ Copied 3 files → devbox:~/.azure/
Use --yes to skip confirmation prompts and forward everything detected:
azlin new --name devbox --yesAll detected credentials are forwarded automatically. This is useful for scripted VM creation.
When creating a private VM behind an Azure Bastion, credential forwarding routes SCP through the bastion tunnel automatically:
azlin new --name private-vm --privateNo extra flags needed. azlin detects the bastion tunnel and routes SCP through 127.0.0.1 on the tunneled port.
After connecting to the VM, verify each tool works:
# SSH into the VM
azlin connect devbox
# Check GitHub CLI
gh auth status
# Check Azure CLI
az account show
# Check GitHub Copilot
gh copilot --helpDecline all prompts (press Enter at each — default is No), or interrupt with Ctrl+C during the forwarding phase. The VM remains fully functional; you just need to authenticate each tool manually.
Credential forwarding copies token files as they exist at creation time. If tokens expire:
- Re-authenticate locally (
gh auth login,az login, etc.) - Create a new VM, or manually SCP the updated files:
# Example: refresh GitHub CLI credentials on an existing VM
scp -r ~/.config/gh/ devbox:~/.config/gh/| Problem | Cause | Solution |
|---|---|---|
| "SSH not ready" timeout | VM still booting or NSG blocking port 22 | Wait and retry; check Azure NSG rules allow SSH |
| "Permission denied" during SCP | SSH key not configured | Verify azlin connect works first |
gh auth status fails on VM |
Tokens expired before forwarding | Re-run gh auth login locally, then SCP ~/.config/gh/ |
az account show fails on VM |
Stale MSAL tokens | Run az login on the VM directly |
| No credentials detected | Tools not authenticated locally | Run gh auth login / az login locally first |
See Credential Forwarding Reference for technical details.