diff --git a/.azure/pipelines/build.yaml b/.azure/pipelines/build.yaml index 5b79eec4..bcac4424 100644 --- a/.azure/pipelines/build.yaml +++ b/.azure/pipelines/build.yaml @@ -22,6 +22,18 @@ parameters: - None - Aria +variables: +- group: 'Azure AI CLI Telemetry configuration' +- name: telemetry.type + # NOTE: Do NOT change the name of this variable without also updating the corresponding + # src\ai\.x\config\telemetry.config.json file. This name needs to be a JPath like + # expression to replace a specific value in that CLI telemetry JSON configuration in the + # FileTransform step in the BuildStage below + value: ${{ parameters.telemetryType }} +- name: telemetry.aria.tenantId + # NOTE: Do NOT change the name of this variable without updating the telemetry JSON config + value: $(AriaTenantId_Release) + stages: - stage: SetupStage @@ -48,9 +60,12 @@ stages: AICLISemVerVersion: $[ stageDependencies.SetupStage.SetupJob.outputs['Variables.AICLISemVerVersion']] AICLINuPkgFileName: $[ stageDependencies.SetupStage.SetupJob.outputs['Variables.AICLINuPkgFileName']] steps: - - template: update-config.yaml - parameters: - telemetryType: ${{ parameters.telemetryType }} + - task: FileTransform@1 + displayName: 'Update telemetry configuration' + inputs: + folderPath: '$(Build.SourcesDirectory)/src/ai/.x/config' + fileType: json + targetFiles: telemetry.config.json - task: NuGetAuthenticate@1 - task: DotNetCoreCLI@2 displayName: Build diff --git a/.azure/pipelines/update-config.yaml b/.azure/pipelines/update-config.yaml deleted file mode 100644 index 7fc56826..00000000 --- a/.azure/pipelines/update-config.yaml +++ /dev/null @@ -1,24 +0,0 @@ -parameters: -- name: telemetryType - type: string - default: None - -variables: -- group: 'Azure AI CLI Telemetry configuration' -# NOTE: Do NOT update the names of the variables here without also updating the corresponding -# src\ai\.x\config\telemetry.config.json file. The variable names here need to be JPath like -# to replace specific values in that JSON configuration file. Please refer to the documentation -# for the FileTransform task for more details: -# https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/file-transform-v1 -- name: telemetry.type - value: ${{ parameters.telemetryType }} -- name: telemetry.aria.tenantId - value: $(AriaTenantId_Release) - -steps: -- task: FileTransform@1 - displayName: 'Update telemetry configuration' - inputs: - folderPath: '$(Build.SourcesDirectory)/src/ai/.x/config' - fileType: json - targetFiles: telemetry.config.json