trigger: none

extends:
    template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
    parameters:
      ServiceDirectory: keyvault
      PersistOidcToken: true
      BuildTargetingString: "azure-keyvault-keys"
      JobName: azure_keyvault_keys
      TestTimeoutInMinutes: 240
      CloudConfig:
        Public:
          Location: 'westus2'
      # HSMs are expensive and restricted in number so we only test them on one platform.
      AdditionalMatrixConfigs:
        - Name: keyvault_hsm_matrix_addons
          Path: sdk/keyvault/azure-keyvault-keys/platform-matrix.json
          Selection: sparse
          GenerateVMJobs: true

      # Due to the high cost of Managed HSMs, we only want to test using them weekly.
      ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }}:
        MatrixFilters:
          - ArmTemplateParameters=^(?!.*enableHsm.*true)
      EnvVars:
        AZURE_TEST_RUN_LIVE: true
        AZURE_SKIP_LIVE_RECORDING: 'True'
