How can I pass a variable group in Jmeter using Azure Pipeline?

后端 未结 3 1064
离开以前
离开以前 2020-12-04 04:26

I need to use the Variable group in the azure pipeline that links to Azure Key Vault secret. The secret will be used to connect to a sql database.

Is there a way th

3条回答
  •  佛祖请我去吃肉
    2020-12-04 04:52

    Using Azure variables:

    In file.jmx add your Azure global or pipeline local variables, on this case I add the user_name. In jMeter I suggest add a Config Element > Used Defined Variables and add a variable as:

     Name          | Value
     user_name     | ${__groovy( System.getenv("USER_NAME") )}
    

    In case you are passing secret password add the reference in the variables by using the Property option as

    Name           | Value
    user_password  | ${__P(USER_PASSWORD)}
    

    Set your variable locally on jMeter > bin path as

       set USER_NAME=rmd_test_4
    

    In your jMeter requests, you should use the variable ${user_name} and ${user_password}. Your Azure command should be the same as if you run them locally in your CLI as follows:

       Locally: jmeter -n -t test_flow.jmx -JUSER_PASSWORD=abc123
       Azure:   jmeter -n -t test_flow.jmx -Juser_pwd=$(RMD_TEST_PASS)
    

    I hope this may help

提交回复
热议问题