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.
Set up a sample private endpoint
To demonstrate this scenario, we’ll use a simple web application, that shows a welcome message, deployed to an Azure Kubernetes Service (AKS) cluster.
On the Overview page, under Get Started, choose the option to create a test by uploading a JMeter script.
On the Test Plan tab, upload the JMX script that we created above.
On the Load tab, configure the test traffic mode as Private and select the peered virtual network that we created above.
You can add the AKS cluster on which the app is hosted to monitor it during the load test.
Once the test is created, run it and view the test results.
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: