Skip to content

Commit 050d2e6

Browse files
Assign Contributor role to Service Principal
1 parent bdf04d3 commit 050d2e6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ 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 }}
140148
141149
- name: Get Deployment Output and extract Values
142150
id: get_output
@@ -403,4 +411,4 @@ jobs:
403411
if: always()
404412
run: |
405413
az logout
406-
echo "Logged out from Azure."
414+
echo "Logged out from Azure."

0 commit comments

Comments
 (0)