How to completly disable Azure Bastion and stop getting charged for not using

Jarzynowski, Matthew 566 36 Reputation points
2021-02-02T22:50:22.863+00:00

How can I completely disable Azure Bastion. I am using a student account with limited credits and am getting charged for a service that I only used once. I deleted the subnet but am still getting charged. Thanks to anyone who can help

Azure Bastion
Azure Bastion
An Azure service that provides private and fully managed Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to virtual machines.
241 questions
0 comments No comments
{count} votes

Accepted answer
  1. suvasara-MSFT 10,001 Reputation points
    2021-02-03T06:42:28.513+00:00

    @JarzynowskiMatthew566-6633, Bastion starts charging when the resource gets created. To stop the charge, you will need to delete the resource. Besides the normal rental, the inbound traffic is also charged.

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

    Ref: https://learn.microsoft.com/en-us/cli/azure/network/bastion?view=azure-cli-latest#az_network_bastion_delete

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    3 people found this answer helpful.

5 additional answers

Sort by: Most helpful
  1. Geovanny Urgiles 16 Reputation points
    2021-06-09T16:48:11.577+00:00

    I manually deleted the Azure Bastion in my subscription. A couple of days after, I noticed that the charges for Bastion services (Azure Bastion) remain increasing.
    I did research, and I found this post.
    I run the "List" command in Azure cloud shell: "az network bastion list" . As a result, I got all the information related to my Azure Bastion.
    Then I run the Delete command: az network bastion delete --name MyBastionHost --resource-group MyResourceGroup ; I got the message "command is in preview and under development," but I let it run. It took around 5 minutes to complete. After that, I run the "List" command again, and this time, it shows no information at all, which means it was deleted. I am going to keep an eye on the charges under Cost Analysis.

    3 people found this answer helpful.
    0 comments No comments

  2. Joshua Awesome 6 Reputation points
    2021-11-08T18:21:44.817+00:00

    It took about 3 minutes and this was the result.

    az : The term 'az' is not recognized as the name of a cmdlet, function, script 
    file, or operable program. Check the spelling of the name, or if a path was 
    included, verify that the path is correct and try again.
    At C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.9\Downloads\s
    cript2.ps1:1 char:2
    +  az network bastion delete --name MyBastionHost --resource-group MyRe ...
    +  ~~
        + CategoryInfo          : ObjectNotFound: (az:String) [], CommandNotFoundE 
       xception
        + FullyQualifiedErrorId : CommandNotFoundException
    
    1 person found this answer helpful.
    0 comments No comments

  3. Balys Rutkauskas 6 Reputation points
    2022-07-19T10:03:57.66+00:00

    I have tried: az network bastion delete --resource-group RandomResources-rg --name MyBastionHost
    Still I have Azure resource which is Type Bastion
    If I run: az network bastion list --resource-group RandomResources-rg
    I get:
    [
    "id": "/subscriptions//resourceGroups/RandomResources-rg/providers/Microsoft.Network/bastionHosts/RandomResources-rg-vnet-bastion",
    "ipConfigurations": [
    {
    "etag": "W/\"4b45cd72-3488-408a-8ca7-27364108ef95\"",
    "id": "/subscriptions/
    /resourceGroups/RandomResources-rg/providers/Microsoft.Network/bastionHosts/RandomResources-rg-vnet-bastion/bastionHostIpConfigurations/IpConf",
    "name": "IpConf",
    "privateIpAllocationMethod": "Dynamic",
    "provisioningState": "Succeeded",
    "publicIpAddress": {
    "id": "/subscriptions//resourceGroups/RandomResources-rg/providers/Microsoft.Network/publicIPAddresses/RandomResources-rg-vnet-ip",
    "resourceGroup": "RandomResources-rg"
    },
    "resourceGroup": "RandomResources-rg",
    "subnet": {
    "id": "/subscriptions/
    /resourceGroups/RandomResources-rg/providers/Microsoft.Network/virtualNetworks/RandomResources-rg-vnet/subnets/AzureBastionSubnet",
    "resourceGroup": "RandomResources-rg"
    },
    "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations"
    }
    ],

    So there are still 3 resources left:
    Bastion - RandomResources-rg-vnet-bastion
    VNET: RandomResources-rg-vnet
    Public IP address: RandomResources-rg-vnet-ip

    1 person found this answer helpful.
    0 comments No comments

  4. Simon Burbery 546 Reputation points
    2021-09-28T04:38:41.207+00:00

    Yes several resources are related to the created bastion host. VM, NIC, Disk and Subnet. I found if I went to 'All Resources' then typed 'bast' to filter, I could then delete the NIC and Disk, followed by the VM and Subnet. Then all charges stopped.

    0 comments No comments