Check! Create an environment for Azure Bastion with Azure CLI
Azure Bastion is useful to connect to virtual machines instantly and keep safe your virtual network that insides machines.
Currently, Azure CLI doesn’t support creation of Azure Bastion yet. But the feature request has raised on issues like below. So I expect to become be able to use that.
Although, we can prepare the environment almost by using Azure CLI now. See the sample code below.
Then, you can deploy Azure Bastion through the Azure portal or Azure PowerShell. See the pages below.
- Create an Azure Bastion host by Azure portal | Microsoft Docs
- Create an Azure Bastion host by Azure PowerShell | Microsoft Docs
Or you can create the Bastion from VM’s blade on the Azure portal. Click Connect
and select BASTION
tab, then you get the blade to create new Azure Bastion. Set your public address that created at above, and click Create
button.

After that, you can access your VM through the Bastion safely.