Skip to content

Commit 35aeb2f

Browse files
authored
Added UserManaged Identity Changes to replace PAT (#1449)
1 parent 634ba58 commit 35aeb2f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/released-version.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
- cron: "0 0 * * *"
66
workflow_dispatch:
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
Run_Test:
1014
runs-on: ubuntu-latest
@@ -17,6 +21,18 @@ jobs:
1721
with:
1822
python-version: '3.12'
1923

24+
- name: Azure Login using Managed Identity
25+
uses: azure/login@v2
26+
with:
27+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
28+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
29+
allow-no-subscriptions: true
30+
31+
- name: Retrieve Azure Access Token
32+
id: ado-token
33+
run: |
34+
echo "token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 | jq -r .accessToken)" >> $GITHUB_OUTPUT
35+
2036
- name: Set up virtual environment
2137
run: |
2238
python -m venv env
@@ -30,5 +46,5 @@ jobs:
3046
azdev test azure-devops --live --no-exitfirst --series
3147
env:
3248
AZURE_DEVOPS_EXT_TEST_ORG: ${{ secrets.AZURE_DEVOPS_EXT_TEST_ORG }}
33-
AZURE_DEVOPS_EXT_PAT: ${{ secrets.AZURE_DEVOPS_EXT_PAT }}
49+
AZURE_DEVOPS_EXT_PAT: ${{ steps.ado-token.outputs.token }}
3450

0 commit comments

Comments
 (0)