From 56b22fa0b10cd9c86994105673ccfe0bd2b2dd67 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 9 Aug 2023 15:31:08 -0700 Subject: [PATCH] =?UTF-8?q?cherry-pick(#26380):=20devops(merge):=20authori?= =?UTF-8?q?ze=20service=20principal=20by=20us=E2=80=A6=20(#26384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ing a client secret Pass all credentials via environment variable as described on [this page](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory#authorize-a-service-principal-by-using-a-client-secret-1) instead of using `azcopy login`. --- .github/workflows/create_test_report.yml | 6 ++++-- .github/workflows/tests_service.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml index 9cb5593baa6d1..2b4a57dc88829 100644 --- a/.github/workflows/create_test_report.yml +++ b/.github/workflows/create_test_report.yml @@ -36,11 +36,13 @@ jobs: - name: Upload HTML report to Azure run: | REPORT_DIR='run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}' - azcopy login --service-principal --application-id ${{ secrets.AZURE_CLIENT_ID }} --tenant-id ${{ secrets.AZURE_TENANT_ID }} azcopy cp --recursive "./playwright-report/*" "https://mspwblobreport.blob.core.windows.net/\$web/$REPORT_DIR" echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html" env: - AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}' + AZCOPY_AUTO_LOGIN_TYPE: SPN + AZCOPY_SPA_APPLICATION_ID: '${{ secrets.AZCOPY_SPA_APPLICATION_ID }}' + AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZCOPY_SPA_CLIENT_SECRET }}' + AZCOPY_TENANT_ID: '${{ secrets.AZCOPY_TENANT_ID }}' - name: Read pull request number uses: ./.github/actions/download-artifact diff --git a/.github/workflows/tests_service.yml b/.github/workflows/tests_service.yml index 45c2ad797208f..82418ffa015c0 100644 --- a/.github/workflows/tests_service.yml +++ b/.github/workflows/tests_service.yml @@ -60,8 +60,10 @@ jobs: - name: Upload HTML report to Azure run: | REPORT_DIR='run-service-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}' - azcopy login --service-principal --application-id ${{ secrets.AZURE_CLIENT_ID }} --tenant-id ${{ secrets.AZURE_TENANT_ID }} azcopy cp --recursive "./playwright-report/*" "https://mspwblobreport.blob.core.windows.net/\$web/$REPORT_DIR" echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html#?q=s:failed" env: - AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}' + AZCOPY_AUTO_LOGIN_TYPE: SPN + AZCOPY_SPA_APPLICATION_ID: '${{ secrets.AZCOPY_SPA_APPLICATION_ID }}' + AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZCOPY_SPA_CLIENT_SECRET }}' + AZCOPY_TENANT_ID: '${{ secrets.AZCOPY_TENANT_ID }}'