-
Notifications
You must be signed in to change notification settings - Fork 380
Description
I am opening this ticket to combine the requests of a couple of previously closed tickets.
The first issue #248 was raised over a year ago reporting the exact same behavior as what I am seeing currently. Specifically, I am attempting to log in a federated credential on a user-managed identity. I'm getting the same set of errors shown in the screenshot on that image. Specifically

Issue #248 was closed because this action did not support OIDC login to Government clouds at that time. However, pull request #321 has since resolved that incompatibility.
The second issue is #298, which was closed in May of this year due to pr #321 being merged. However, as was called out by @danelson after #298 was closed, pr #321 does not add support for OIDC login with enable-AzPSSession: true. I can confirm #321 does seem to log in when enable-AzPSSession: false or left at default when using the same credentials.
Workflow code:
name: Test Azure powershell login with OIDC
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
test-oidc-login-ps:
runs-on: ubuntu-latest
environment: beta # valid environment
steps:
- name: OIDC Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
environment: 'AzureUSGovernment'
enable-AzPSSession: true # works if this is not included