Running load tests against private endpoints is a common scenario. The endpoints may be sitting behind a firewall, or they may be only accessible from within a virtual network, or they may not have been made public yet as they are under development. Microsoft Azure Load Testing supports private endpoint load testing using VNet injection. This injects the load generating virtual machines into the same virtual network as your private endpoint.
Azure Load Testing support for private endpoint load testing is currently available in seven regions with expansion on the horizon. What if you want to initiate a load test from a different region than where your application is? What if the virtual network sits in a different subscription? Or if private endpoint load testing is not supported yet in your region? You don’t have to worry. Virtual network peering is a simple workaround to unblock your load tests against private endpoints. Virtual network peering enables you to seamlessly connect two or more virtual networks in Azure. The peered virtual networks appear as one for connectivity purposes.
Let’s see how to go about it.
To demonstrate this scenario, we’ll use a simple web application, that shows a welcome message, deployed to an Azure Kubernetes Service (AKS) cluster.
Let’s set up this private endpoint in ‘North Central US’ region.
We’ve now deployed an app that is accessible only from the ‘demo_vnet’ virtual network.
We'll now create a virtual network in a different region, South Central US, and peer the virtual network with the demo_vnet virtual network that hosts our application.
Now that the two virtual networks are peered and appear as one for connectivity purposes, we can run a load test against our private endpoint.
Let’s test this private endpoint for performance using Azure Load Testing.
Since the virtual network peering has been set up, the test traffic was successfully sent to the web app. The load test ran successfully, and we could view and analyze how the app responded to the load by using the dashboard. Otherwise, we would have seen errors and wouldn’t have been able to run the load test.
Using virtual network peering, we were able to generate load for the private endpoint deployed in a region other than the Load Testing resource and generate load test results.
What else are you waiting for? The YAML file for the sample app and the JMX file are added in the attachments. Try it out and leave us a comment below if leveraging virtual network peering with Azure Load Testing worked for you.
If you have any feedback on Azure Load Testing, let us know through our feedback forum.
Happy Load Testing…!
To learn more about Azure Load Testing, here are a few links to get you started:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.