can we de allocate application gateway or disck associated with Azure VM

Ramakant Galande 21 Reputation points
2021-12-22T08:57:34.62+00:00

like for Azure VM we can stop vm for reducing the cost, but disk associated with still costs.
is there any way so that we can de allocate the Disk/app gateway

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,052 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prrudram-MSFT 28,366 Reputation points Microsoft Employee Moderator
    2021-12-23T05:27:46.55+00:00

    Hello @Ramakant Galande ,

    In addition to what @Andreas Baumgarten suggested. You can leverage Azure CLI or PS incase, Azure Portal doesn’t allow you to stop application gateway.

    In such cases, Azure cmdline helps. Open the Azure Cloud Shell or local PowerShell with Az module installed and use the following:

    Get Azure Application Gateway

    $appgw=Get-AzApplicationGateway -Name <appgw_name> -ResourceGroupName <rg_name>

    Stop the Azure Application Gateway

    Stop-AzApplicationGateway -ApplicationGateway $appgw

    Start the Azure Application Gateway (optional)

    Start-AzApplicationGateway -ApplicationGateway $appgw

    Azure Portal updates the Application Gateway:

    Azure Portal - Application Gateway Stopping
    Verify the application gateway has stopped state. You will only billed for the public IP assigned to the stopped Application Gateway (saves money significantly):

    159908-image.png

    Please "Accept as Answer" if any of above helped so that, it can help others in community looking for remediation for the similar issues.


1 additional answer

Sort by: Most helpful
  1. Andreas Baumgarten 123.7K Reputation points MVP Volunteer Moderator
    2021-12-22T09:11:08.653+00:00

    Hi @Ramakant Galande ,

    disk resources of a VM in Azure can't be deallocated. If the VM is deallocated only the VM compute costs are affected.
    The reason is: The disk resources are required for the VM (OS disk, data disk) and occupy space/resources in Azure even if the VM is stopped/deallocated.

    As far as I know an Azure Application Gateway can't be deallocated as well. The only option to save money is to delete the app gateway and redeploy (manually or via script) every time it is needed.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.