Skip to content

Commit 3eb9268

Browse files
Assign Contributor role to Service Principal
Add role assignment step for Service Principal in deployment workflow.
1 parent f5dd9b9 commit 3eb9268

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ jobs:
137137
capacity=${{ env.GPT_MIN_CAPACITY }} \
138138
imageVersion="${IMAGE_TAG}" \
139139
createdBy="Pipeline"
140+
- name: Assign Contributor role to Service Principal
141+
if: always()
142+
run: |
143+
echo "Assigning Contributor role to SPN for RG: ${{ env.RESOURCE_GROUP_NAME }}"
144+
az role assignment create \
145+
--assignee ${{ secrets.AZURE_CLIENT_ID }} \
146+
--role "Contributor" \
147+
--scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}
148+
140149
141150
- name: Get Deployment Output and extract Values
142151
id: get_output

0 commit comments

Comments
 (0)