azureazure-active-directoryazure-vm-scale-setazure-vm

How to disable the Azure Bastion for Virtual Machine in Azure cloud?


I am using a Virtual Machine in Azure portal. Over there, I connected the VM via RDP. Now when I saw at my credits $19 are spent and the uses by Azure Bastion.

After it, I did some R&D and figured out how to delete all Azure Bastion resources via Azure PowerShell. I deleted all Azure Bastion and checked with this command az network bastion network and the list is empty.

After a day, I again connected the VM via RDP and today when I checked the used details, it has increased by $4.

My question is, why is this happening even after deleted all bastion resources in Azure Portal and how can I stop it completely because I don't want to be charged more?


Solution

  • Please use the below command to check all the azure bastion hosts.

    az network bastion list
    

    If any bastion hosts are present, you can delete them using below command :

    az network bastion delete --name MyBastionHost --resource-group MyResourceGroup
    

    After deleting your bastion host, make sure to delete your public IP created for bastion host.

    Please use the below command to delete public IP :

    az network public-ip delete -g MyResourceGroup -n MyIp
    

    Please refer the below document for the pricing of Bastion :

    https://azure.microsoft.com/en-us/pricing/details/azure-bastion/