microsoft / azure-load-testing

MIT License
22 stars 3 forks source link

[BUG] Azure DevOps task not setting up ENV and Secrets #126

Closed cathalmchale closed 1 year ago

cathalmchale commented 1 year ago

Describe the bug Azure DevOps task not setting up ENV and Secrets.

To Reproduce Steps to reproduce the behavior:

  1. Create an Azure DevOps pipeline with task to create/run an Azure Load Test.
  2. Configure task with some ENV and Secret Json specified.
  3. Run pipeline and observe that the created Azure Load Test has no ENV or Secrets configured.
  4. Add some ENV and Secret values manually to the Load Test in the Azure Portal.
  5. Re-run the pipeline and observe that the ENV and Secret values setup manually get erased.

Expected behavior Required ENV and Secret values configured in the Azure Load Test by the CI/CD pipeline task. Note: Do not get any error in the pipeline when creating the test / uploading the jmx for an already existing test. But when test runs with 100% errors and I click configure in the Azure Portal, I can see that the ENV and Secrets parameters are blank.

Screenshots Have the Azure DevOps pipeline setup like below:

    - task: AzureLoadTest@1
      displayName: 'Run basic data verify test'
      inputs:
        azureSubscription: 'ARM via SP'
        loadTestConfigFile: '$(Build.SourcesDirectory)/devops/jmeter/HcapBasicDataVerifyConfig.yaml'
        resourceGroup: 'rg-perf-dev'
        loadTestResource: 'load-PerformanceTest-dev'
        secrets: |
          [
             {
              "name": "apimsupportsecret",
              "value": "https://vault-myorg-rsrc.vault.azure.net/secrets/LoadTest-MySupportUserSecret-DEV"
             }
          ]
        env: |
          [
             {
              "name": "apimroot",
              "value": "developer.myorg.com"
             },
             {
              "name": "apimsubscription",
              "value": "953efc736e7b46309711d013b57e4a97"
             },
             {
              "name": "apimsupportuser",
              "value": "MySupportUser"
             }
          ]

Above ENV / Secrets not configured when pipeline runs. If setup ENV / Secrets manually in Azure Portal, then run the pipeline again, it'll actually erase what you setup manually.

image

AB#1687200

Nagarjuna-Vipparthi commented 1 year ago

@cathalmchale Can you please share the test run IDs for us to debug the issue? Thanks

cathalmchale commented 1 year ago

Then I manually added back in ENV and Secrets to get Pass (should be only difference to 442f1a11-fcc3-4c08-bf8d-4cd3cd58fd0b above):

cathalmchale commented 1 year ago

@Nagarjuna-Vipparthi could you find any root cause from the test runs for this issue?

ninallam commented 1 year ago

@cathalmchale When you provide your env and secrets in the task directly, these are considered as runtime parameters and are available only for the test run. They are not persistent for the test. If you want the parameters to be persistent, you can define this in the YAML file directly as mentioned here https://learn.microsoft.com/azure/load-testing/reference-test-config-yaml. Closing this since it is not a bug. If you have any further questions, please reopen.