Key vault access from Azure load test using RBAC role

Arvind Vijay Vergiya 20 Reputation points
2025-07-17T14:51:27.66+00:00

Hi, I'm trying to retrieve secret from Azure Key Vault during the execution of a JMeter test using an Azure Load Test. I've configured secret parameter in the load test and am attempting to access it in the JMeter script using ${__GetSecret(<my-secret-name>)}. The managed identity for Azure Load Testing has been assigned the 'Key Vault Secrets User' RBAC role to grant access on Key Vault. However, the test fails with the error shown below.

ERROR c.a.c.j.j.f.GetSecret: __GetSecret function is not allowed in a sampler or a listener

We are not using Key Vault access policies as described in the Microsoft documentation, and we need this to work using RBAC.

https://learn.microsoft.com/en-us/azure/load-testing/how-to-parameterize-load-tests?tabs=jmeter#use-secrets-in-apache-jmeter

Azure Load Testing
Azure Load Testing
An Azure service that enables developers and testers to generate insights on how to improve the performance, scalability, and capacity usage of their application
{count} votes

Your answer

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