Skip to content

Commit 37efb28

Browse files
authored
Update Azure login workflow for permissions and steps
1 parent 124cb8f commit 37efb28

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: "Copilot - Azure Login"
22

3-
# Automatically run the setup steps when they are changed to allow for easy validation, and
4-
# allow manual testing through the repository's "Actions" tab
53
on:
64
workflow_dispatch:
75

@@ -17,34 +15,27 @@ env:
1715
ARM_USE_OIDC: true
1816

1917
jobs:
20-
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
2118
copilot-setup-steps:
2219
runs-on: ubuntu-latest
2320
environment: demo
2421

25-
# Set the permissions to the lowest permissions possible needed for your steps.
26-
# Copilot will be given its own token for its operations.
22+
# Job-level permissions override workflow-level, so you must include id-token here
2723
permissions:
28-
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
2924
contents: write
25+
id-token: write # Required for Azure federated identity
3026

31-
# You can define any steps you want, and they will run before the agent starts.
32-
# If you do not check out your code, Copilot will do this for you.
3327
steps:
3428
- name: Checkout code
3529
uses: actions/checkout@v5
3630

37-
# Setup Azure Federated Identity Credentials
3831
- name: Azure CLI Login
3932
uses: azure/login@v2
4033
with:
4134
client-id: ${{ secrets.ARM_CLIENT_ID }}
4235
tenant-id: ${{ secrets.ARM_TENANT_ID }}
4336
subscription-id: ${{ secrets.ARM_SUBSCRIPTION_ID }}
44-
- name: 'Validate Workload Identity Auth Works'
45-
uses: azure/login@v2
46-
with:
47-
azcliversion: latest
48-
inlineScript: |
49-
az account show
50-
az group list
37+
38+
- name: Validate Workload Identity Auth Works
39+
run: |
40+
az account show
41+
az group list

0 commit comments

Comments
 (0)