File tree Expand file tree Collapse file tree 1 file changed +15
-23
lines changed
content/actions/deployment/security-hardening-your-deployments Expand file tree Collapse file tree 1 file changed +15
-23
lines changed Original file line number Diff line number Diff line change @@ -65,36 +65,28 @@ The [`azure/login`](https://github.com/Azure/login) action receives a JWT from t
6565
6666The following example exchanges an OIDC ID token with Azure to receive an access token, which can then be used to access cloud resources.
6767
68+ {% raw %}
6869``` yaml{:copy}
69- name: Run Azure Login with OpenID Connect
70+ name: Run Azure Login with OIDC
7071on: [push]
7172
7273permissions:
7374 id-token: write
74-
75+ contents: read
7576jobs:
7677 build-and-deploy:
7778 runs-on: ubuntu-latest
7879 steps:
79-
80- - name: Installing CLI-beta for OpenID Connect
81- run: |
82- cd ../..
83- CWD="$(pwd)"
84- python3 -m venv oidc-venv
85- . oidc-venv/bin/activate
86- echo "activated environment"
87- python3 -m pip install -q --upgrade pip
88- echo "started installing cli beta"
89- pip install -q --extra-index-url https://azcliprod.blob.core.windows.net/beta/simple/ azure-cli
90- echo "***************installed cli beta*******************"
91- echo "$CWD/oidc-venv/bin" >> $GITHUB_PATH
92-
93- - name: 'Az CLI login'
94- 95- with:
96- client-id: {% raw %}${{ secrets.AZURE_CLIENTID }}{% endraw %}
97- tenant-id: {% raw %}${{ secrets.AZURE_TENANTID }}{% endraw %}
98- subscription-id: {% raw %}${{ secrets.AZURE_SUBSCRIPTIONID }}{% endraw %}
80+ - name: 'Az CLI login'
81+ uses: azure/login@v1
82+ with:
83+ client-id: ${{ secrets.AZURE_CLIENT_ID }}
84+ tenant-id: ${{ secrets.AZURE_TENANT_ID }}
85+ subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
86+
87+ - name: 'Run az commands'
88+ run: |
89+ az account show
90+ az group list
9991```
100-
92+ {% endraw %}
You can’t perform that action at this time.
0 commit comments