Created
May 29, 2025 20:45
-
-
Save jreypo/11ba4bae78d15351e96488757984e25a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Azure Bastion tunnel script (PowerShell version) by @jreypo | |
| # | |
| # Requires Azure CLI installed in your Windows machine | |
| # | |
| $rg = Read-Host "Enter resource group name" | |
| $bastion = Read-Host "Enter Bastion name" | |
| $vmname = Read-Host "Enter virtual machine name" | |
| $resourceport = Read-Host "Enter remote resource port" | |
| $port = Read-Host "Enter local port" | |
| $vmid = az vm show --resource-group $rg --name $vmname --query id --output tsv | |
| az network bastion tunnel --resource-group $rg --target-resource-id $vmid --resource-port $resourceport --port $port --name $bastion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment