Skip to content

Conversation

@duncan3dc
Copy link

In some of our workflows we use docker containers to ensure we've got a consistent environment. We use this action to authenticate with OIDC, but this action assumes the az CLI is running on the GitHub actions machine.

This PR allows a custom az path to be specified, so that we can authenticate inside the docker container, and then run our following az commands in there.

For example:

- name: Setup docker container
  run: |
    docker build . -t ci-image
    docker run --interactive --detach \
      --env ACTIONS_ID_TOKEN_REQUEST_URL=$ACTIONS_ID_TOKEN_REQUEST_URL \
      --env ACTIONS_ID_TOKEN_REQUEST_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN \
      --name ci ci-image

- name: Authenticate with Azure
  uses: azure/login@v2
  with:
    client-id: "${{ secrets.AZURE_CLIENT_ID }}"
    tenant-id: "${{ secrets.AZURE_TENANT_ID }}"
    subscription-id: "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
    az-path: "docker exec ci az"

- name: Now we can run az inside our container
  run: docker exec ci az account show

@MoChilia MoChilia self-requested a review October 27, 2025 01:49
@MoChilia MoChilia self-assigned this Oct 27, 2025
@MoChilia MoChilia added feature-request Azure Cli For Azure CLI issue. labels Oct 27, 2025
@MoChilia
Copy link
Member

Hi @duncan3dc, thank you for your contribution. I appreciate this feature. But I would prefer setting it as an environment variable rather than using a parameter.

@YanaXu For consistency, should we consider whether Azure PowerShell will also require a custom path?

@MoChilia MoChilia requested a review from YanaXu October 27, 2025 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure Cli For Azure CLI issue. feature-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants