From 8fdc092481fbb4c5ba4e2d508c17c1ab7e2ace4d Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 17:42:24 +0800 Subject: [PATCH 01/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 322 ++++----------------------------------- 1 file changed, 29 insertions(+), 293 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index d724d2886..45ecdf23a 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -1,297 +1,33 @@ -# Docker -# Build and push an image to Azure Container Registry -# https://docs.microsoft.com/azure/devops/pipelines/languages/docker -pr: - drafts: false trigger: -- none +- main -resources: -- repo: self +jobs: +- job: call_api + pool: + vmImage: 'ubuntu-latest' + steps: + - task: AzureCLI@2 + inputs: + azureSubscription: 'Hydra Lab Subscription' + scriptType: bash + scriptLocation: inlineScript + inlineScript: | + echo "Getting token via federated identity..." -variables: - # Container registry service connection established during pipeline creation - # Agent VM image name -- name: vmImageName - value: 'windows-latest' -- name: fullBuild - value: $[ne(variables['Build.Reason'], 'PullRequest')] -- name: securityScan - value: $[or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule'))] + az login --service-principal \ + --username $AZURE_CLIENT_ID \ + --tenant $AZURE_TENANT_ID \ + --federated-token $SYSTEM_ACCESSTOKEN \ + --allow-no-subscriptions -stages: -- stage: Build - displayName: Build and push stage - jobs: - - job: Build - displayName: Build - pool: - vmImage: $(vmImageName) - steps: - - task: NodeTool@0 - inputs: - versionSpec: '18.x' - - task: Npm@1 - inputs: - command: 'install' - workingDir: 'react' - - task: Npm@1 - inputs: - command: 'custom' - workingDir: 'react' - customCommand: 'run pub' - - task: CodeInspector@2 - displayName: "[Security Review] code inspector" - inputs: - ProductId: '606a5e0d-64b0-4237-9dca-eac200438452' - condition: eq(variables.securityScan, 'true') - - task: CodeQL3000Init@0 - displayName: "[Security Review] CodeQL Init" - condition: eq(variables.securityScan, 'true') - - task: CredScan@3 - displayName: "[Security Review] CredScan" - condition: eq(variables.securityScan, 'true') - - task: PowerShell@2 - displayName: Generate Env File - inputs: - targetType: 'inline' - script: | - if(Test-Path variable:BLOB_CONNECTION_STRING){ - New-Item -Path common/src/test/resources -Name ".env" -ItemType "file" -Value "BLOB_CONNECTION_STRING = $(BLOB_CONNECTION_STRING)" - }else{ - Write-Host "No BLOB_CONNECTION_STRING found" - } - workingDirectory: '$(Build.Repository.LocalPath)' - condition: eq(variables.fullBuild, 'false') - - task: PowerShell@2 - displayName: Set center/agent version - inputs: - targetType: 'inline' - script: | - $PSDefaultParameterValues['*:Encoding'] = 'utf8' - $hydraVersionCode = $(Build.BuildId) - $hydraVersion = "$(Build.SourceBranchName).$(Build.BuildId)" - $branchName = "$(Build.SourceBranch)" - - (Get-Content agent/src/main/resources/version.properties) -Replace '1000000', "$hydraVersionCode"| Set-Content agent/src/main/resources/version.properties - (Get-Content center/src/main/resources/version.properties) -Replace '1000000', "$hydraVersionCode"| Set-Content center/src/main/resources/version.properties - - if($branchName -like '*Release*'){ - (Get-Content agent/src/main/resources/version.properties) -Replace '0.0.0', $hydraVersion| Set-Content agent/src/main/resources/version.properties - (Get-Content center/src/main/resources/version.properties) -Replace '0.0.0', $hydraVersion| Set-Content center/src/main/resources/version.properties - } - echo "##vso[task.setvariable variable=hydraVersionCode;]$hydraVersionCode" - echo "##vso[task.setvariable variable=hydraVersion;]$hydraVersion" - workingDirectory: '$(Build.Repository.LocalPath)' - - task: Gradle@3 - displayName: Run JUnit Test - inputs: - gradleWrapperFile: 'gradlew' - tasks: 'test jacocoRootReport --stacktrace' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - #codeCoverageToolOption: 'JaCoCo' - #codeCoverageClassFilesDirectories: 'build/classes/java/main' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - sonarQubeRunAnalysis: false - spotBugsAnalysis: false - condition: eq(variables.fullBuild, 'false') - - task: PowerShell@2 - displayName: Delete Env File - inputs: - targetType: 'inline' - script: | - if(Test-Path common/src/test/resources/.env){ - Remove-Item -Path common/src/test/resources/.env -Force - }else{ - Write-Host "No .env file found" - } - workingDirectory: '$(Build.Repository.LocalPath)' - condition: eq(variables.fullBuild, 'false') - - task: PublishCodeCoverageResults@1 - displayName: Publich Code Coverage - inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: 'build/reports/jacoco/jacocoRootReport/*.xml' - reportDirectory: 'build/reports/jacoco/jacocoRootReport/html' - condition: eq(variables.fullBuild, 'false') - - task: Gradle@2 - displayName: Package Android client APK - inputs: - workingDirectory: 'android_client' - gradleWrapperFile: 'android_client/gradlew' - tasks: 'assembleRelease --stacktrace' - publishJUnitResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - options: '-PclientVersionCode=$(hydraVersionCode) -PclientVersionNumber=$(hydraVersion)' - - task: Gradle@2 - displayName: Package Android client APK - inputs: - workingDirectory: 'android_client' - gradleWrapperFile: 'android_client/gradlew' - tasks: 'assembleAndroidTest --stacktrace' - publishJUnitResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - options: '-PclientVersionCode=$(hydraVersionCode) -PclientVersionNumber=$(hydraVersion)' - - task: PowerShell@2 - displayName: Copy APK to folder for deployment - inputs: - targetType: 'inline' - script: | - cp android_client/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk common/src/main/resources/record_androidTest.apk -force - - task: PowerShell@2 - displayName: Copy APK to folder for deployment - inputs: - targetType: 'inline' - script: | - cp android_client/app/build/outputs/apk/release/app-release.apk common/src/main/resources/record_release.apk -force - - task: Gradle@2 - displayName: Build center - inputs: - gradleWrapperFile: 'gradlew' - tasks: 'center:bootJar --stacktrace' - publishJUnitResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - sonarQubeRunAnalysis: false - spotBugsAnalysis: false - - task: Gradle@2 - displayName: Build agent - inputs: - gradleWrapperFile: 'gradlew' - tasks: 'agent:bootJar --stacktrace' - publishJUnitResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - sonarQubeRunAnalysis: false - spotBugsAnalysis: false - - task: CopyFiles@2 - displayName: Copy deploy center files - inputs: - SourceFolder: 'center/' - Contents: 'Dockerfile' - TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy deploy center files 2 - inputs: - SourceFolder: 'center/deploy_startup/' - Contents: '**' - TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy/deploy_startup' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy deploy center files 3 - inputs: - SourceFolder: 'center/uber_image/' - Contents: 'hydra_lab_center_docker_db.sqlite' - TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy/deploy_startup' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy deploy center files 4 - inputs: - SourceFolder: 'common/src/main/resources/' - Contents: | - record_release.apk - record_androidTest.apk - TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy/deploy_startup' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy center jar - inputs: - SourceFolder: 'center/build/libs/' - Contents: '*.jar' - TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy' - condition: eq(variables.fullBuild, 'true') - - task: Gradle@2 - displayName: Package Mac installer - inputs: - gradleWrapperFile: 'gradlew' - tasks: 'packageMacInstaller --stacktrace' - publishJUnitResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - sonarQubeRunAnalysis: false - spotBugsAnalysis: false - condition: eq(variables.fullBuild, 'true') - - task: Gradle@2 - displayName: Package Windows installer - inputs: - gradleWrapperFile: 'gradlew' - tasks: 'packageWindowsInstaller --stacktrace' - publishJUnitResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - sonarQubeRunAnalysis: false - spotBugsAnalysis: false - condition: eq(variables.fullBuild, 'true') - - task: PowerShell@2 - displayName: Copy APK & Mapping file to artifact - inputs: - targetType: 'inline' - script: | - mkdir -p $(Build.ArtifactStagingDirectory)/android_client - cp android_client/app/build/outputs/apk/release/app-release.apk $(Build.ArtifactStagingDirectory)/android_client/app-release-$(hydraVersion).apk - if(Test-Path android_client/app/build/outputs/mapping/release/mapping.txt){ - cp android_client/app/build/outputs/mapping/release/mapping.txt $(Build.ArtifactStagingDirectory)/android_client/ - } - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy agent jar - inputs: - SourceFolder: 'agent/build/libs/' - Contents: '*.jar' - TargetFolder: '$(Build.ArtifactStagingDirectory)/agent_deploy' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy agent installer - inputs: - SourceFolder: 'build/installer/' - Contents: '*.zip' - TargetFolder: '$(Build.ArtifactStagingDirectory)/agent_deploy' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy deploy uber files 1 - inputs: - SourceFolder: 'common/src/main/resources/' - Contents: | - record_release.apk - record_androidTest.apk - TargetFolder: '$(Build.ArtifactStagingDirectory)/uber_image' - condition: eq(variables.fullBuild, 'true') - - task: CopyFiles@2 - displayName: Copy deploy uber files 2 - inputs: - SourceFolder: 'center/uber_image/' - Contents: '**' - TargetFolder: '$(Build.ArtifactStagingDirectory)/uber_image' - condition: eq(variables.fullBuild, 'true') - - task: PowerShell@2 - displayName: Add Release Tag - inputs: - targetType: 'inline' - script: | - Write-Host "##vso[build.addbuildtag]Release" - workingDirectory: '$(Build.Repository.LocalPath)' - condition: and(eq(variables.fullBuild, 'true'), contains(variables['Build.SourceBranch'], 'Release/')) - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'HydraLabRelease' - publishLocation: 'Container' - condition: eq(variables.fullBuild, 'true') - - task: CodeQL3000Finalize@0 - displayName: "[Security Review] CodeQL Finalize" - condition: eq(variables.securityScan, 'true') - - task: securedevelopmentteam.vss-secure-development-tools.build-task-report.SdtReport@2 - # https://strikecommunity.azurewebsites.net/articles/8216/how-to-enable-build-break-on-credscan-detections.html - displayName: "[Security Review] Create CredScan Security Analysis Report" - inputs: - GdnExportHtmlFile: true - GdnExportAllTools: false - GdnExportGdnToolBinSkim: true - GdnExportGdnToolCredScan: true - GdnExportGdnToolSemmle: true - condition: eq(variables.securityScan, 'true') \ No newline at end of file + ACCESS_TOKEN=$(az account get-access-token \ + --resource api://04856ca1-e39d-49d9-a72a-006e28ddbd0e \ + --query accessToken -o tsv) + + echo "Calling protected API..." + curl -H "Authorization: Bearer $ACCESS_TOKEN" \ + https://hydralabtest.azurewebsites.net/api/device/list + env: + AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' + AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' + SYSTEM_ACCESSTOKEN: $(System.AccessToken) From 404775eb57d4e97f94c71403f453741a6f98af5e Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 17:46:56 +0800 Subject: [PATCH 02/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 45ecdf23a..da6028eb8 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -21,13 +21,13 @@ jobs: --allow-no-subscriptions ACCESS_TOKEN=$(az account get-access-token \ - --resource api://04856ca1-e39d-49d9-a72a-006e28ddbd0e \ + --resource api://0d3e6299-ee68-44de-8ea8-a93433a00f8a \ --query accessToken -o tsv) echo "Calling protected API..." curl -H "Authorization: Bearer $ACCESS_TOKEN" \ https://hydralabtest.azurewebsites.net/api/device/list env: - AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' + AZURE_CLIENT_ID: '0d3e6299-ee68-44de-8ea8-a93433a00f8a' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' SYSTEM_ACCESSTOKEN: $(System.AccessToken) From 00cd2ed9b77458dbe2378aaea41555c526089c5c Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 17:59:51 +0800 Subject: [PATCH 03/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index da6028eb8..ee0e2aa41 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -14,14 +14,8 @@ jobs: inlineScript: | echo "Getting token via federated identity..." - az login --service-principal \ - --username $AZURE_CLIENT_ID \ - --tenant $AZURE_TENANT_ID \ - --federated-token $SYSTEM_ACCESSTOKEN \ - --allow-no-subscriptions - ACCESS_TOKEN=$(az account get-access-token \ - --resource api://0d3e6299-ee68-44de-8ea8-a93433a00f8a \ + --resource HydraLab.Test \ --query accessToken -o tsv) echo "Calling protected API..." From 157cab207309d96c6a5424bebbf319309a489e5c Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:01:13 +0800 Subject: [PATCH 04/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index ee0e2aa41..641ebe340 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -14,6 +14,8 @@ jobs: inlineScript: | echo "Getting token via federated identity..." + az login + ACCESS_TOKEN=$(az account get-access-token \ --resource HydraLab.Test \ --query accessToken -o tsv) From 40fabbf5d14cbf20f45cc2f4e6bc0c7e3058418b Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:02:56 +0800 Subject: [PATCH 05/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 641ebe340..f40b42189 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -17,7 +17,7 @@ jobs: az login ACCESS_TOKEN=$(az account get-access-token \ - --resource HydraLab.Test \ + --resource api://0d3e6299-ee68-44de-8ea8-a93433a00f8a \ --query accessToken -o tsv) echo "Calling protected API..." From 7eb163eb16da2f2abf375060fcf2a01f8dbfee73 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:15:53 +0800 Subject: [PATCH 06/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index f40b42189..52f6ea57d 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -8,7 +8,7 @@ jobs: steps: - task: AzureCLI@2 inputs: - azureSubscription: 'Hydra Lab Subscription' + azureSubscription: 'hydraTest' scriptType: bash scriptLocation: inlineScript inlineScript: | @@ -17,13 +17,13 @@ jobs: az login ACCESS_TOKEN=$(az account get-access-token \ - --resource api://0d3e6299-ee68-44de-8ea8-a93433a00f8a \ + --resource api://228c4d51-5002-4fcf-8752-552b478fff77 \ --query accessToken -o tsv) echo "Calling protected API..." curl -H "Authorization: Bearer $ACCESS_TOKEN" \ https://hydralabtest.azurewebsites.net/api/device/list env: - AZURE_CLIENT_ID: '0d3e6299-ee68-44de-8ea8-a93433a00f8a' + AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' SYSTEM_ACCESSTOKEN: $(System.AccessToken) From 835ae6b3fd11d8736244a95d98086d1f181ab9c6 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:17:12 +0800 Subject: [PATCH 07/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 52f6ea57d..edc0b69a4 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -14,8 +14,8 @@ jobs: inlineScript: | echo "Getting token via federated identity..." - az login - + az account get-access-token --query accessToken --resource=https://database.windows.net -o tsv + echo "Calling protected API..." ACCESS_TOKEN=$(az account get-access-token \ --resource api://228c4d51-5002-4fcf-8752-552b478fff77 \ --query accessToken -o tsv) From 3f624dfb85d656062d98de1be245a182a7c706fa Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:22:26 +0800 Subject: [PATCH 08/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index edc0b69a4..6f37eeee5 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -21,8 +21,13 @@ jobs: --query accessToken -o tsv) echo "Calling protected API..." - curl -H "Authorization: Bearer $ACCESS_TOKEN" \ + + response=$(curl -s -X GET \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $ACCESS_TOKEN" \ https://hydralabtest.azurewebsites.net/api/device/list + ) + echo $response env: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' From f8a47f061e1a03aa7d32afcde028b498c50496a1 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:22:40 +0800 Subject: [PATCH 09/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 6f37eeee5..b1b7e3456 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -14,8 +14,6 @@ jobs: inlineScript: | echo "Getting token via federated identity..." - az account get-access-token --query accessToken --resource=https://database.windows.net -o tsv - echo "Calling protected API..." ACCESS_TOKEN=$(az account get-access-token \ --resource api://228c4d51-5002-4fcf-8752-552b478fff77 \ --query accessToken -o tsv) From b3a1f7ac428c6d86e97042f417db2525e3549dfd Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:26:37 +0800 Subject: [PATCH 10/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index b1b7e3456..ff2204a19 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -25,7 +25,7 @@ jobs: -H "Authorization: Bearer $ACCESS_TOKEN" \ https://hydralabtest.azurewebsites.net/api/device/list ) - echo $response + echo $response | jq env: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' From 4045297fd204d98591c1328fd3f2a2872a28fbdb Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:30:31 +0800 Subject: [PATCH 11/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index ff2204a19..9979aca89 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -20,7 +20,7 @@ jobs: echo "Calling protected API..." - response=$(curl -s -X GET \ + response=$(curl -v -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://hydralabtest.azurewebsites.net/api/device/list From fa481d2eb4c32e015adc6b94493ae01f156a709f Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:33:05 +0800 Subject: [PATCH 12/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 9979aca89..19a79d4fc 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -20,6 +20,8 @@ jobs: echo "Calling protected API..." + echo "Length of string: ${#ACCESS_TOKEN}" + response=$(curl -v -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ From 6b4fea0477342f17195b73d1c185ac277695639d Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:56:09 +0800 Subject: [PATCH 13/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 19a79d4fc..ae34432e7 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -21,6 +21,7 @@ jobs: echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" + echo "##vso[task.setvariable variable=debugSecret;issecret=false]$(ACCESS_TOKEN)" response=$(curl -v -X GET \ -H "Content-Type: application/json" \ @@ -32,3 +33,6 @@ jobs: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' SYSTEM_ACCESSTOKEN: $(System.AccessToken) + + - script: echo $(debugSecret) + displayName: 'Print exposed secret' From c96e5be4054f6058dacc0dff785daed1b906c502 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 18:59:07 +0800 Subject: [PATCH 14/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index ae34432e7..1b8772768 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -22,7 +22,8 @@ jobs: echo "Length of string: ${#ACCESS_TOKEN}" echo "##vso[task.setvariable variable=debugSecret;issecret=false]$(ACCESS_TOKEN)" - + echo "Printing secret value (debug only):" + echo $(debugSecret) response=$(curl -v -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ @@ -33,6 +34,3 @@ jobs: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' SYSTEM_ACCESSTOKEN: $(System.AccessToken) - - - script: echo $(debugSecret) - displayName: 'Print exposed secret' From cb76c6e586e2756bff38c1cfa289f8dc5becb27c Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:01:36 +0800 Subject: [PATCH 15/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 1b8772768..fad0e619b 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -21,7 +21,7 @@ jobs: echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - echo "##vso[task.setvariable variable=debugSecret;issecret=false]$(ACCESS_TOKEN)" + echo "##vso[task.setvariable variable=debugSecret;issecret=false]$ACCESS_TOKEN" echo "Printing secret value (debug only):" echo $(debugSecret) response=$(curl -v -X GET \ From 15d970863905443e205820c19eb2a2529282d2cb Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:11:43 +0800 Subject: [PATCH 16/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index fad0e619b..4c7445c57 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -23,7 +23,8 @@ jobs: echo "Length of string: ${#ACCESS_TOKEN}" echo "##vso[task.setvariable variable=debugSecret;issecret=false]$ACCESS_TOKEN" echo "Printing secret value (debug only):" - echo $(debugSecret) + $(TEST)=ACCESS_TOKEN + response=$(curl -v -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ @@ -34,3 +35,12 @@ jobs: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' SYSTEM_ACCESSTOKEN: $(System.AccessToken) + - task: Bash@3 + inputs: + targetType: 'inline' + script: | + # Write your commands here + + echo $(debugSecret) + echo $(TEST) + From d86d676e60bf5b949e0ba05486b0828f565df6cd Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:13:51 +0800 Subject: [PATCH 17/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 4c7445c57..e25dba252 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -21,10 +21,8 @@ jobs: echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - echo "##vso[task.setvariable variable=debugSecret;issecret=false]$ACCESS_TOKEN" - echo "Printing secret value (debug only):" - $(TEST)=ACCESS_TOKEN - + + echo $ACCESS_TOKEN | cut -d "." -f2 | base64 -d | jq response=$(curl -v -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ @@ -35,12 +33,4 @@ jobs: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' SYSTEM_ACCESSTOKEN: $(System.AccessToken) - - task: Bash@3 - inputs: - targetType: 'inline' - script: | - # Write your commands here - - echo $(debugSecret) - echo $(TEST) From edac4ab872e5bcbd8313c4b7702684384fdd9831 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:20:38 +0800 Subject: [PATCH 18/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index e25dba252..a8c0e7aef 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -4,7 +4,9 @@ trigger: jobs: - job: call_api pool: - vmImage: 'ubuntu-latest' + name: YP_Performance_Test + demands: + - Agent.Name -equals MININT-T69DC43 steps: - task: AzureCLI@2 inputs: From a448ad5d503ccf78b1409d2200fd29bd278a93a5 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:23:52 +0800 Subject: [PATCH 19/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index a8c0e7aef..fe3ed5ff9 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -23,6 +23,7 @@ jobs: echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" + New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN" echo $ACCESS_TOKEN | cut -d "." -f2 | base64 -d | jq response=$(curl -v -X GET \ From 2268f04b429315096416911b80956f88b1800d26 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:27:08 +0800 Subject: [PATCH 20/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index fe3ed5ff9..f6477c776 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -11,12 +11,12 @@ jobs: - task: AzureCLI@2 inputs: azureSubscription: 'hydraTest' - scriptType: bash - scriptLocation: inlineScript + scriptType: 'ps' + scriptLocation: 'inlineScript' inlineScript: | echo "Getting token via federated identity..." - ACCESS_TOKEN=$(az account get-access-token \ + $ACCESS_TOKEN=$(az account get-access-token \ --resource api://228c4d51-5002-4fcf-8752-552b478fff77 \ --query accessToken -o tsv) From 6bcc8f853bc18f8b66f8702db1e49a1ee22d7c64 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:31:27 +0800 Subject: [PATCH 21/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index f6477c776..e2c91233d 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -15,10 +15,7 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | echo "Getting token via federated identity..." - - $ACCESS_TOKEN=$(az account get-access-token \ - --resource api://228c4d51-5002-4fcf-8752-552b478fff77 \ - --query accessToken -o tsv) + $ACCESS_TOKEN=az account get-access-token --query accessToken --resource=https://database.windows.net -o tsv echo "Calling protected API..." @@ -26,12 +23,18 @@ jobs: New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN" echo $ACCESS_TOKEN | cut -d "." -f2 | base64 -d | jq - response=$(curl -v -X GET \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $ACCESS_TOKEN" \ - https://hydralabtest.azurewebsites.net/api/device/list - ) - echo $response | jq + + $headers = @{ +     "Content-Type"  = "application/json" +     "Authorization" = "Bearer $ACCESS_TOKEN" + } + + $response = Invoke-RestMethod -Uri "https://hydralabtest.azurewebsites.net/api/device/list" ` +                               -Method Get ` +                               -Headers $headers + + $response | ConvertTo-Json -Depth 10 + env: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' AZURE_TENANT_ID: '72f988bf-86f1-41af-91ab-2d7cd011db47' From d0bac19cfa3971da10d1460165f5a708d0bc6d83 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:33:50 +0800 Subject: [PATCH 22/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index e2c91233d..c42033504 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -22,18 +22,17 @@ jobs: echo "Length of string: ${#ACCESS_TOKEN}" New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN" - echo $ACCESS_TOKEN | cut -d "." -f2 | base64 -d | jq - $headers = @{ -     "Content-Type"  = "application/json" -     "Authorization" = "Bearer $ACCESS_TOKEN" - } + # $headers = @{ + #     "Content-Type"  = "application/json" + #     "Authorization" = "Bearer $ACCESS_TOKEN" + # } - $response = Invoke-RestMethod -Uri "https://hydralabtest.azurewebsites.net/api/device/list" ` -                               -Method Get ` -                               -Headers $headers + # $response = Invoke-RestMethod -Uri "https://hydralabtest.azurewebsites.net/api/device/list" ` + #                               -Method Get ` + #                               -Headers $headers - $response | ConvertTo-Json -Depth 10 + # $response | ConvertTo-Json -Depth 10 env: AZURE_CLIENT_ID: '04856ca1-e39d-49d9-a72a-006e28ddbd0e' From 059ad657416438775b12cf228127225e6db2319b Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:34:51 +0800 Subject: [PATCH 23/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index c42033504..f1dc3d6c7 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -22,6 +22,8 @@ jobs: echo "Length of string: ${#ACCESS_TOKEN}" New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN" + Start-Sleep -Seconds 50 + # $headers = @{ #     "Content-Type"  = "application/json" From 12ca3410446d5a7ea2c2d23d6b26901314bd0150 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:36:19 +0800 Subject: [PATCH 24/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index f1dc3d6c7..baf7381db 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -15,7 +15,7 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | echo "Getting token via federated identity..." - $ACCESS_TOKEN=az account get-access-token --query accessToken --resource=https://database.windows.net -o tsv + $ACCESS_TOKEN=az account get-access-token --query accessToken --resource=api://228c4d51-5002-4fcf-8752-552b478fff77 -o tsv echo "Calling protected API..." From fd83f5717a06d78441984be26ec5f0224fee2e61 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 19:56:11 +0800 Subject: [PATCH 25/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index baf7381db..5bc2a5b46 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -15,12 +15,13 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | echo "Getting token via federated identity..." - $ACCESS_TOKEN=az account get-access-token --query accessToken --resource=api://228c4d51-5002-4fcf-8752-552b478fff77 -o tsv + $ACCESS_TOKEN=az account get-access-token --query accessToken --scope =api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv + $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope =api://228c4d51-5002-4fcf-8752-552b478fff77/HydraLab.Test -o tsv echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN" + New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2" Start-Sleep -Seconds 50 From 4c147922a2470597ca585c33cebe79c92142ce0b Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 20:06:02 +0800 Subject: [PATCH 26/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 5bc2a5b46..58a67599e 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -15,8 +15,8 @@ jobs: scriptLocation: 'inlineScript' inlineScript: | echo "Getting token via federated identity..." - $ACCESS_TOKEN=az account get-access-token --query accessToken --scope =api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv - $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope =api://228c4d51-5002-4fcf-8752-552b478fff77/HydraLab.Test -o tsv + $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv + $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/HydraLab.Test -o tsv echo "Calling protected API..." From e4babbd9eef382ae4ef38b7c08c6f51e4c1a9873 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 20:31:23 +0800 Subject: [PATCH 27/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 58a67599e..e6973e0fd 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -16,7 +16,7 @@ jobs: inlineScript: | echo "Getting token via federated identity..." $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv - $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/HydraLab.Test -o tsv + $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope 228c4d51-5002-4fcf-8752-552b478fff77 -o tsv echo "Calling protected API..." From 430acf6df797418c5051de34b5eea306c999c5cc Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Mon, 9 Jun 2025 20:46:25 +0800 Subject: [PATCH 28/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index e6973e0fd..6852b18bb 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -16,7 +16,7 @@ jobs: inlineScript: | echo "Getting token via federated identity..." $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv - $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope 228c4d51-5002-4fcf-8752-552b478fff77 -o tsv + $ACCESS_TOKEN2=az account get-access-token --query accessToken --resource https://hydralabtest.azurewebsites.net -o tsv echo "Calling protected API..." From 7c6f92bcae1dc567b564f45a4b451d18ededa778 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Tue, 10 Jun 2025 09:23:20 +0800 Subject: [PATCH 29/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 6852b18bb..4eec0a585 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -16,7 +16,7 @@ jobs: inlineScript: | echo "Getting token via federated identity..." $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv - $ACCESS_TOKEN2=az account get-access-token --query accessToken --resource https://hydralabtest.azurewebsites.net -o tsv + $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope https://graph.microsoft.com/.default -o tsv echo "Calling protected API..." From 50e82642977615f5282af47262f73098ec238652 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Tue, 10 Jun 2025 09:35:10 +0800 Subject: [PATCH 30/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 4eec0a585..f0669c54e 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -17,11 +17,12 @@ jobs: echo "Getting token via federated identity..." $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope https://graph.microsoft.com/.default -o tsv + $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope api://04856ca1-e39d-49d9-a72a-006e28ddbd0e/.default -o tsv echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2" + New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$ACCESS_TOKEN3" Start-Sleep -Seconds 50 From 0223b31251f254be3f36196cb7372cb41e0e1039 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Tue, 10 Jun 2025 09:53:37 +0800 Subject: [PATCH 31/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index f0669c54e..eef8a6fee 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -17,7 +17,6 @@ jobs: echo "Getting token via federated identity..." $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope https://graph.microsoft.com/.default -o tsv - $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope api://04856ca1-e39d-49d9-a72a-006e28ddbd0e/.default -o tsv echo "Calling protected API..." From 10658f282e2b75a1d759d9fa3426cb965dc7fe66 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Tue, 10 Jun 2025 10:37:25 +0800 Subject: [PATCH 32/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index eef8a6fee..463ade935 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -18,10 +18,11 @@ jobs: $ACCESS_TOKEN=az account get-access-token --query accessToken --scope api://228c4d51-5002-4fcf-8752-552b478fff77/.default -o tsv $ACCESS_TOKEN2=az account get-access-token --query accessToken --scope https://graph.microsoft.com/.default -o tsv + echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$ACCESS_TOKEN3" + New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$SYSTEM_ACCESSTOKEN" Start-Sleep -Seconds 50 From 968389c8f5ea7b814f8c315e2282d7e3dffc9515 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Tue, 10 Jun 2025 10:40:21 +0800 Subject: [PATCH 33/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 463ade935..6980205b1 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -22,7 +22,7 @@ jobs: echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$SYSTEM_ACCESSTOKEN" + New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$(SYSTEM_ACCESSTOKEN)" Start-Sleep -Seconds 50 From cf83c98ad6731deb7fa594e43fd5c659fed9d2b8 Mon Sep 17 00:00:00 2001 From: Le Zhou <2428499107@qq.com> Date: Tue, 10 Jun 2025 10:42:30 +0800 Subject: [PATCH 34/34] Update azure-pipelines-test.yml for Azure Pipelines --- azure-pipelines-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index 6980205b1..c95c4d4c7 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -22,7 +22,7 @@ jobs: echo "Calling protected API..." echo "Length of string: ${#ACCESS_TOKEN}" - New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$(SYSTEM_ACCESSTOKEN)" + New-Item -Path sdk -Name ".env" -ItemType "file" -Value "DB_TOKEN=$ACCESS_TOKEN`DB_TOKEN2=$ACCESS_TOKEN2`DB_TOKEN3=$(System.AccessToken)" Start-Sleep -Seconds 50