Bandwidth Hit Cost me CAD$400+ on Azure VM

Ali Khuzema 0 Reputation points
2025-12-12T08:53:29.0866667+00:00

I have deployed a web-application on an Azure VM B2s (Linux). Few days back the server unexpectedly got down, the issue it was showing was of an unknown agent, which got fixed when I stopped the server and started it again. After a day, my application was down although the server was running after looking at the metrics it was showing 90%+ memory usage, and after debugging we found some malware, which we have currently removed.

I want to know how this happened, and how can it be avoided in future, as this application posesses sensitive data, Also i got hit of CAD$400+ which I want the refund as well, as I didn't receive any alerts/notification of any kind.

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

1 answer

Sort by: Most helpful
  1. Ankit Yadav 8,025 Reputation points Microsoft External Staff Moderator
    2025-12-12T10:10:15.7+00:00

    Hey Ali Khuzema,

    it sounds like you're dealing with a few issues related to your Azure VM, including unexpected downtime, memory usage spikes, malware, and high costs. Let's break this down.

    Issue Overview

    1. Unexpected Downtime: Your VM seemingly went down due to an unknown agent, which you resolved by restarting the server.
    2. Memory Usage Spikes: You observed over 90% memory usage and identified some malware, which you've since removed.
    3. High Costs: You incurred over CAD$400 in charges and didn’t receive alerts about the usage.

    Possible Causes and Prevention

    1. Unknown Agent and Downtime:
      • Such issues could be caused by resource exhaustion (due to high memory/running processes) or potential system or application malfunctions. Regular monitoring of your VM's health through tools like Azure Monitor can help you catch these issues early.
    2. High Memory Usage:
      • Malware can cause significant spikes in resource usage. To prevent future instances:
        • Regularly update your VM and its applications to patch vulnerabilities.
        • Implement a robust antivirus solution within the VM.
        • Consider using Azure Security Center to enhance your security posture.
    3. High Costs:
      • Azure VM costs can escalate due to factors such as:
        • High egress bandwidth charges, especially if data is transferred out of Azure frequently.
        • Not properly deallocating VMs when not in use (make sure to see "Stopped (Deallocated)" status).
      • To avoid unplanned costs:
        • Set up alerts and budgets with Azure Cost Management.
        • Use the Azure Pricing Calculator to better estimate your costs.
        • Download your usage details for a daily breakdown of charges to identify spikes.

    Follow-Up Questions To offer more tailored assistance, could you provide additional information on the following?

    1. What kind of monitoring or alerting setups do you currently have for your Azure resources?
    2. Have you considered using any security solutions or services to protect your application and VM from future malware attacks?
    3. Can you share details about your application’s data transfer patterns? (e.g., how often it sends or receives data)
    4. Are you part of any Azure support plan currently?

    References

    Hope this helps, and feel free to reach out if you have more questions!


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.