Share via

Inquiry: Retaining Azure Configurations without Active Resource Charges

kapil koujalagi 0 Reputation points
2026-05-14T08:43:39.26+00:00

Hi Team,

I frequently use Azure for research and knowledge-building trials. To support my learning, I need to retain specific configurations and settings for future reference even after I have finished using the primary resources.

Recently, I deleted my VM resources but continued to incur charges for associated components like the NAT Gateway.

Could you provide a step-by-step guide on how to preserve infrastructure configurations (such as networking and security settings) without incurring ongoing subscription costs once the compute resources are released? I am looking for the most cost-effective way to "pause" or store these setups for later use.

Thanks in advance,

Kapil

Cost Management
Cost Management

A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.


2 answers

Sort by: Most helpful
  1. kagiyama yutaka 2,590 Reputation points
    2026-05-14T09:13:42.09+00:00

    I think u just save the rg as an ARM/Bicep template and remove only the paid stuff (VMs, disks, NAT gw, load balancer, public IP, ACR, Key Vault, Storage, Insights), keep the free vnet/nsg, and the whole setup stays at zero cost until u redeploy it.

    Was this answer helpful?

    0 comments No comments

  2. Q&A Assist
    2026-05-14T08:44:13.7733333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To retain Azure configurations for learning while avoiding ongoing charges, focus on two principles:

    1. Ensure all billable compute/network resources are stopped or deleted.
    2. Persist only the minimal, non-running artifacts (templates, scripts, documentation) outside of active Azure resources.

    Key cost behaviors to keep in mind

    1. Virtual machines (VMs)
      • A VM in Stopped state (shut down from inside the OS) still reserves compute and incurs compute charges.
      • A VM in Deallocated state (stopped from Azure portal/CLI/PowerShell) releases compute; no compute charges accrue.
      • Disks, networks, and some other attached resources can still incur charges even after the VM is deleted.
      • In the Azure portal, using Stop on the VM deallocates it. Shutting down from inside the OS only stops it and continues billing.
    2. Disks and storage
      • Managed disks (OS and data disks) continue to incur storage charges even if the VM is deleted, unless the disk itself is deleted.
      • For VMs, by default the OS disk is deleted with the VM, but it can be configured to be retained; retained disks continue to accrue costs.
    3. Networking and load balancing
      • Virtual networks (VNets) are billed per subscription and per region.
      • Load balancers are billable; for example, in Azure Machine Learning and Foundry scenarios, each compute instance or cluster can have a load balancer that continues to accrue daily cost until the compute resource is deleted.
      • NAT gateways and similar networking components behave like other billable network resources: if left deployed, they continue to incur charges even after VMs are removed.
    4. Platform services around compute
      • For services like Azure Machine Learning or Foundry hubs, associated resources such as Azure Container Registry, Blob Storage, Key Vault, and Azure Monitor/Application Insights continue to accrue costs after the main workspace/hub is deleted, unless explicitly deleted.

    Cost‑effective patterns to “pause” or preserve configurations

    1. Use deallocation when temporarily pausing VMs
      • For short-term pauses (hours to a few days) where the VM must remain intact:
        • Stop the VM from the Azure portal (or CLI/PowerShell) so it is Deallocated, not just Stopped.
        • This avoids compute charges while preserving the VM configuration and attached disks.
      • Remember that disks and some network resources still incur storage/network charges.
    2. Export infrastructure as code before deletion
      • Before deleting billable resources (VMs, NAT gateways, load balancers, VNets):
        • Export the configuration as templates or scripts so it can be recreated later without keeping the resources running.
      • Practical approaches:
        • Export ARM/Bicep templates for resource groups or specific resources.
        • Capture network and security configuration (VNets, subnets, NSGs, route tables, NAT gateways) into templates.
      • After exporting, delete the actual resources (VMs, NAT gateways, load balancers, etc.) so they no longer incur charges.
    3. Minimize what remains in Azure
      • To avoid surprises like NAT Gateway charges after VM deletion:
        • After deleting VMs, review the resource group for:
          • Load balancers
          • NAT gateways
          • Public IPs
          • Virtual networks
          • Managed disks
        • Delete any components that are not strictly needed.
      • If the goal is purely educational reference, keep only:
        • Templates (stored in source control or storage)
        • Documentation/notes
        • Possibly a minimal storage account for templates (if not stored outside Azure)
    4. Be aware of “hidden” or dependent resources
      • For Azure Machine Learning workspaces:
        • VMs, load balancers, VNets, and bandwidth can accrue costs before workspace deletion.
        • After workspace deletion, dependent resources like Azure Container Registry, Blob Storage, Key Vault, and Application Insights can remain and continue to incur charges until deleted.
      • For Foundry hubs (classic):
        • Before hub deletion, VMs, load balancers, VNets, and bandwidth can accrue costs.
        • After hub deletion, Azure Container Registry, Blob Storage, Key Vault, and Application Insights (if enabled) remain and must be deleted to stop charges.
    5. Use cost management practices alongside configuration preservation
      • Implement policies and governance to avoid accidentally creating expensive resources:
        • Use “Allowed virtual machine SKUs” policies to restrict VM sizes to cost‑appropriate options.
        • Use policies to restrict public IPs on network interfaces to reduce unnecessary network and bandwidth costs.
        • Audit resources that incur costs even after VM deletion (for example, disks, VNets, load balancers) so they can be cleaned up.
      • For recurring learning environments, consider:
        • Standardized templates that deploy only what is needed.
        • Scripts to deploy and tear down entire environments quickly.
    6. When in doubt, fully delete and rely on templates
      • For long-term “paused” learning environments where cost must be near zero:
        • Export all configurations as code.
        • Delete:
          • VMs (ensuring OS/data disks are deleted unless explicitly needed)
          • NAT gateways and load balancers
          • VNets and public IPs if not required for other workloads
          • Dependent resources such as Container Registry, Blob Storage, Key Vault, and Application Insights that are dedicated to the lab.
        • Recreate the environment from templates when needed.

    This pattern preserves the design and configuration while ensuring that no active compute or networking resources remain to generate charges.


    References:

    Was this answer helpful?

Your answer

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