From ff0aef37f847ee5fc99bff1fc8fbd9fc38a20d4d Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 8 Aug 2023 22:50:36 -0700 Subject: [PATCH] devops: use azcopy for better upload performance (#26360) The credentials are created with `az ad sp create-for-rbac --name "playwright-github-actions" --role "Storage Blob Data Contributor" --scopes /subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts/` We cannot use `azure/login@v1` for login as it does not see to properly propagate credentials to `azcopy` in the next step (there are some reports about keyring problems on linux based actions). --- .github/workflows/create_test_report.yml | 5 ++++- .github/workflows/tests_service.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml index bc3f74aa31698..9cb5593baa6d1 100644 --- a/.github/workflows/create_test_report.yml +++ b/.github/workflows/create_test_report.yml @@ -36,8 +36,11 @@ jobs: - name: Upload HTML report to Azure run: | REPORT_DIR='run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}' - az storage blob upload-batch -s playwright-report -d "\$web/$REPORT_DIR" --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}" + 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 }}' - 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 8a1ab0ad090b8..45c2ad797208f 100644 --- a/.github/workflows/tests_service.yml +++ b/.github/workflows/tests_service.yml @@ -60,5 +60,8 @@ jobs: - name: Upload HTML report to Azure run: | REPORT_DIR='run-service-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}' - az storage blob upload-batch -s playwright-report -d "\$web/$REPORT_DIR" --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}" + 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 }}'