Skip to content

Commit

Permalink
Don't look up AD SP ID
Browse files Browse the repository at this point in the history
  • Loading branch information
ebronson68 committed Aug 20, 2024
1 parent 468c14c commit 48e2bb0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/azfunction-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,11 @@ jobs:
with:
inlineScript: |
set -eu
# Retrieve the object ID of the managed identity
objectId=$(az ad sp show --id ${{ env.functionAppIdentity }} --query objectId --output tsv)
# Retrieve the Key Vault ID
keyVaultId=$(az keyvault show --name ${{ env.keyVaultName }} --query id --output tsv)
# Assign the Key Vault Secrets User role to the managed identity using object ID and principal type
az role assignment create --role "Key Vault Secrets User" --assignee-object-id $objectId --assignee-principal-type ServicePrincipal --scope $keyVaultId
az role assignment create --role "Key Vault Secrets User" --assignee-object-id --assignee-principal-type ServicePrincipal ${{ env.functionAppIdentity }} --scope $keyVaultId
- name: Retrieve environment variables
if: ${{ env.AZURE_CREDENTIALS_SET != 'false' }}
Expand Down

0 comments on commit 48e2bb0

Please sign in to comment.