Skip to content

Add support for a custom az-path#559

Open
duncan3dc wants to merge 1 commit intoAzure:masterfrom
duncan3dc:support-custom-az-path
Open

Add support for a custom az-path#559
duncan3dc wants to merge 1 commit intoAzure:masterfrom
duncan3dc:support-custom-az-path

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
@srceenr29y1
Copy link

srceenr29y1 commented Mar 6, 2026 via email

@MoChilia MoChilia removed their assignment Mar 9, 2026
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.

4 participants