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. For details on the available APIs, see the Function Reference (select the relevant version).

To run scripts containing VuGen's Azure APIs, you need to install the LoadRunner Azure API Service on each load generator machine that will run the scripts. To replay the scripts in VuGen, install the service on the VuGen machine. For details, see Install the LoadRunner Azure API Service.

Back to top

Access Key Vault secrets from Vuser scripts

You use the following APIs to access Key Vault secrets from a Vuser script. For more details, see Azure API functions.

  • lr_azure_set_service_port: Specifies a port for the local LoadRunner Azure API Service.
  • lr_azure_ad_client_get_token: Fetches and saves a token required for authentication.
  • lr_azure_kv_get_secret: Fetches and saves the Key Vault secret value. This function requires the saved authentication token from the lr_azure_ad_client_get_token function.

To access a Key Vault secret from a Vuser script:

  1. Insert the lr_azure_set_service_port function into your script to set the service port for the LoadRunner Azure API Service.
  2. 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.
  3. 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 saves the secret value to a specified parameter.

Back to top

See also: