Skip to content

Commit 56b22fa

Browse files
authored
cherry-pick(#26380): devops(merge): authorize service principal by us… (#26384)
…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`.
1 parent 421bffb commit 56b22fa

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/create_test_report.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ jobs:
3636
- name: Upload HTML report to Azure
3737
run: |
3838
REPORT_DIR='run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}'
39-
azcopy login --service-principal --application-id ${{ secrets.AZURE_CLIENT_ID }} --tenant-id ${{ secrets.AZURE_TENANT_ID }}
4039
azcopy cp --recursive "./playwright-report/*" "https://mspwblobreport.blob.core.windows.net/\$web/$REPORT_DIR"
4140
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html"
4241
env:
43-
AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}'
42+
AZCOPY_AUTO_LOGIN_TYPE: SPN
43+
AZCOPY_SPA_APPLICATION_ID: '${{ secrets.AZCOPY_SPA_APPLICATION_ID }}'
44+
AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZCOPY_SPA_CLIENT_SECRET }}'
45+
AZCOPY_TENANT_ID: '${{ secrets.AZCOPY_TENANT_ID }}'
4446

4547
- name: Read pull request number
4648
uses: ./.github/actions/download-artifact

.github/workflows/tests_service.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ jobs:
6060
- name: Upload HTML report to Azure
6161
run: |
6262
REPORT_DIR='run-service-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}'
63-
azcopy login --service-principal --application-id ${{ secrets.AZURE_CLIENT_ID }} --tenant-id ${{ secrets.AZURE_TENANT_ID }}
6463
azcopy cp --recursive "./playwright-report/*" "https://mspwblobreport.blob.core.windows.net/\$web/$REPORT_DIR"
6564
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html#?q=s:failed"
6665
env:
67-
AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}'
66+
AZCOPY_AUTO_LOGIN_TYPE: SPN
67+
AZCOPY_SPA_APPLICATION_ID: '${{ secrets.AZCOPY_SPA_APPLICATION_ID }}'
68+
AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZCOPY_SPA_CLIENT_SECRET }}'
69+
AZCOPY_TENANT_ID: '${{ secrets.AZCOPY_TENANT_ID }}'

0 commit comments

Comments
 (0)