From a7655039a3dfb0a31fe50d08fe2c590dc4232d33 Mon Sep 17 00:00:00 2001 From: Vikas Bhansali <64532198+vibhansa-msft@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:40:44 +0530 Subject: [PATCH 1/4] Test github action cli login with fed token Test github action cli login with fed token --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..6a3407e70 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,24 @@ +name: Run Azure CLI Login with OpenID Connect +on: [push] + +permissions: + id-token: write # Require write permission to Fetch an OIDC token. + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Azure CLI Login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Azure CLI script + uses: azure/cli@v2 + with: + azcliversion: latest + inlineScript: | + az account show + # You can write your Azure CLI inline scripts here. From 92bda1211dfba30087fccff2aaad124bfa9b5329 Mon Sep 17 00:00:00 2001 From: vibhansa Date: Wed, 2 Oct 2024 05:14:41 -0700 Subject: [PATCH 2/4] Updating --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a3407e70..891873b6b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,7 @@ jobs: - name: Azure CLI Login uses: azure/login@v2 with: + auth-type: IDENTITY client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} From a6184032c456ad428c4397ad1aa3f7bad7d0bf07 Mon Sep 17 00:00:00 2001 From: vibhansa Date: Wed, 2 Oct 2024 05:37:18 -0700 Subject: [PATCH 3/4] Updated --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 891873b6b..17aac72de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,8 @@ name: Run Azure CLI Login with OpenID Connect -on: [push] +on: + push: + branches: + - vibhansa-fedTokenTest permissions: id-token: write # Require write permission to Fetch an OIDC token. @@ -11,7 +14,6 @@ jobs: - name: Azure CLI Login uses: azure/login@v2 with: - auth-type: IDENTITY client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} From 5919cd30dabdb9642171b4316b4f1c61b8b47a79 Mon Sep 17 00:00:00 2001 From: vibhansa Date: Wed, 2 Oct 2024 05:45:11 -0700 Subject: [PATCH 4/4] Updated --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17aac72de..a02074e84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,9 +14,11 @@ jobs: - name: Azure CLI Login uses: azure/login@v2 with: + auth-type: IDENTITY client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + enable-AzPSSession: true - name: Azure CLI script uses: azure/cli@v2