Working with Microsoft Azure Key Vault
VuGen enables you to access Microsoft Azure Key Vault secrets from your Vuser scripts.
About VuGen's Azure APIs
Azure Key Vault stores confidential data, such as passwords, certificates, or cryptographic keys, in the form of secrets. VuGen includes API functions you can add to Vuser scripts, to enable access to Key Vault secrets when running the scripts. You can insert these APIs manually into scripts written in the C language.
To run scripts containing VuGen's Azure APIs, the LoadRunner Azure API Service must be installed on each load generator machine that runs the scripts. To replay the scripts in VuGen, install the service on the VuGen machine. For details, see Install the LoadRunner Azure API Service.
Note: Azure Key Vault secrets are supported in DevWeb scripts from version 2022 R2.
Access Key Vault secrets from Vuser scripts
You use the Azure API functions to access Key Vault secrets from a Vuser script. For details on the Azure API functions for C language scripts, see Azure API Functions in the Function Reference.
To access a Key Vault secret from a Vuser script:
- Insert the lr_azure_set_service_port function into your script to set the service port for the LoadRunner Azure API Service. The default port is 16888.
- Insert the lr_azure_ad_client_get_token function into your script and pass the Key Vault authentication credentials to the function. The function saves an authentication token to a specified parameter.
- Insert the lr_azure_kv_get_secret function into your script, and pass the Key Vault secret details and the saved authentication token to the function. The function accesses the secret value and saves it to a specified parameter.