Skip to content

repo sync #12078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,28 @@ The [`azure/login`](https://github.com/Azure/login) action receives a JWT from t

The following example exchanges an OIDC ID token with Azure to receive an access token, which can then be used to access cloud resources.

{% raw %}
```yaml{:copy}
name: Run Azure Login with OpenID Connect
name: Run Azure Login with OIDC
on: [push]

permissions:
id-token: write

contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:

- name: Installing CLI-beta for OpenID Connect
run: |
cd ../..
CWD="$(pwd)"
python3 -m venv oidc-venv
. oidc-venv/bin/activate
echo "activated environment"
python3 -m pip install -q --upgrade pip
echo "started installing cli beta"
pip install -q --extra-index-url https://azcliprod.blob.core.windows.net/beta/simple/ azure-cli
echo "***************installed cli beta*******************"
echo "$CWD/oidc-venv/bin" >> $GITHUB_PATH

- name: 'Az CLI login'
uses: azure/login@v1.4.0
with:
client-id: {% raw %}${{ secrets.AZURE_CLIENTID }}{% endraw %}
tenant-id: {% raw %}${{ secrets.AZURE_TENANTID }}{% endraw %}
subscription-id: {% raw %}${{ secrets.AZURE_SUBSCRIPTIONID }}{% endraw %}
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: 'Run az commands'
run: |
az account show
az group list
```

{% endraw %}