Skip to content

Commit

Permalink
update azure login
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubakimoto authored May 6, 2024
1 parent b7103aa commit e03595d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/azure-az-login-using-oidc.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# https://docs.microsoft.com/en-us/azure/developer/github/connect-from-azure
# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure
# https://github.com/marketplace/actions/azure-login

name: Az CLI Login using OIDC

on:
# Triggers the workflow on push or pull request events but only for the main branch
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
Expand All @@ -19,16 +13,21 @@ permissions:
jobs:
az-login-with-oidc:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Az CLI Login
uses: azure/login@v1
uses: azure/login@v2
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Show Azure regions
run: az account list-locations
- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az account list-locations -o table
- name: Az CLI Logout
run: az logout
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

jobs:
az-login:
az-login-using-sp:
runs-on: ubuntu-latest

environment: Production
steps:
# https://github.com/fluffy-bunny/azure-login-action-act
- name: Install Azure CLI
Expand All @@ -19,12 +19,16 @@ jobs:
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
- name: Azure Login
uses: Azure/login@v1
uses: Azure/login@v2
with:
creds: ${{secrets.AZURE_CREDENTIALS}}

- name: Show Azure regions
run: az account list-locations
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az account list-locations -o table
- name: Az CLI Logout
run: az logout

0 comments on commit e03595d

Please sign in to comment.