I operate a web server on a VM in Azure. Over the past few months, the VM has been getting hit with a very large number of spam requests that consume resources (which add to the VM bill) and slow down its ability to process real requests. After configuring IIS rewrite rules to drop the majority of the bad traffic, the overall resource usage has dropped significantly, but the server still must process each request before it can know to ignore it.
I'm looking for a way that Azure could be configured to block incoming traffic (by user agent or rate, at a minimum) so that I don't have to rig a custom solution that costs me. Does such a mechanism exist? I was guessing that it might be a feature on a load balancer resource or similar, but was unable to find anything that seemed appropriate.