diff --git a/.github/workflows/azfunction-deploy.yaml b/.github/workflows/azfunction-deploy.yaml index 307e9c5a..b04eb8fb 100644 --- a/.github/workflows/azfunction-deploy.yaml +++ b/.github/workflows/azfunction-deploy.yaml @@ -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' }}