trigger: none

parameters:
  - name: Services
    type: object
    default:
      - azure-keyvault-keys
      - azure-keyvault-secrets
      - azure-keyvault-certificates
      - azure-keyvault-administration

stages:
  - ${{ each service in parameters.Services }}:
    - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
      parameters:
        ServiceDirectory: keyvault
        BuildTargetingString: ${{ service }}
        JobName: ${{ replace(service, '-', '_') }}
        TestTimeoutInMinutes: 240
        SupportedClouds: 'Public,UsGov,China'
        CloudConfig:
          Public:
            SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
          UsGov:
            SubscriptionConfiguration: $(sub-config-gov-test-resources)
            MatrixFilters:
              - ArmTemplateParameters=^(?!.*enableHsm.*true)
          China:
            SubscriptionConfiguration: $(sub-config-cn-test-resources)
            MatrixFilters:
              - ArmTemplateParameters=^(?!.*enableHsm.*true)
        ${{ if or(eq(service, 'azure-keyvault-keys'), eq(service, 'azure-keyvault-administration')) }}:
          AdditionalMatrixConfigs:
            - Name: keyvault_test_matrix_addons
              Path: sdk/keyvault/azure-keyvault-keys/platform-matrix.json
              Selection: sparse
              GenerateVMJobs: true
        EnvVars:
          AZURE_TEST_RUN_LIVE: true
          AZURE_SKIP_LIVE_RECORDING: 'True'
          AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
          AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
          AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
          AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
          AZURE_CLIENT_OID: $(aad-azure-sdk-test-client-oid)
