Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.5.1 breaks multi subscription login #383

Closed
matt-cote opened this issue Dec 6, 2023 · 8 comments
Closed

v1.5.1 breaks multi subscription login #383

matt-cote opened this issue Dec 6, 2023 · 8 comments
Assignees

Comments

@matt-cote
Copy link

matt-cote commented Dec 6, 2023

We have a workflow which copies images between container registries in a dev tenant and a prod tenant which is now failing:
ERROR: Subscription '<dev-subscription-name>' not found. Check the spelling and casing and try again.

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - name: "Azure login dev"
        uses: azure/login@v1
        with:
          client-id: ${{ vars.DEV_CLIENT_ID }}
          tenant-id: ${{ vars.DEV_TENANT_ID }}
          subscription-id: ${{ vars.DEV_SUBSCRIPTION_ID }}

      - name: "Azure login prod"
        uses: azure/login@v1
        with:
          client-id: ${{ vars.PROD_CLIENT_ID }}
          tenant-id: ${{ vars.PROD_TENANT_ID }}
          subscription-id: ${{ vars.PROD_SUBSCRIPTION_ID }}

      - name: Sync
        shell: bash
        run: |
          USERNAME="00000000-0000-0000-0000-000000000000"
          ACCESS_TOKEN=$(az acr login --name <dev-container-registry> --expose-token --output tsv --query accessToken --subscription "<dev-subscription-name>")
          ...
          az acr import --name "$destination" --source "$source_image" --username "$USERNAME" --password "$ACCESS_TOKEN"

Appears to be caused by #377 as pinning to v1.5.0 works.

@matt-cote matt-cote added the need-to-triage Requires investigation label Dec 6, 2023
@YanaXu YanaXu removed the need-to-triage Requires investigation label Dec 7, 2023
@YanaXu
Copy link
Collaborator

YanaXu commented Dec 7, 2023

Hi @matt-cote , sorry for this. Please ping to 1.5.0 for a workaround.
You workflow file is clear and helpful. We need some time for your use case to find a better solution.

@matt-cote
Copy link
Author

Thanks @YanaXu.

Perhaps consider adding this functionality behind a new input parameter such as clear-account. To implement it as a non-breaking change, it could default to false. Or if you feel that the default should indeed be true then at least we will have the option to disable it for our use case.

@YanaXu
Copy link
Collaborator

YanaXu commented Dec 7, 2023

Hi @matt-cote, It's a good suggestion. We'll add it to our consideration. We have to go through all use cases and see what Azure CLI and Azure PowerShell should do for keeping or clearing the context. Thanks a lot!

@MoChilia
Copy link
Member

MoChilia commented Jan 9, 2024

Hi @matt-cote,
The new version v1.6.0 of azure/login is aimed to fix your issue. Give azure/login@v1.6.0 a try to verify its effectiveness. Check out the pre-release announcement for v1.6.0 here. Any suggestions or feedback are welcome!

@MoChilia
Copy link
Member

@charlrvd, @Gibstick, @robcao, I saw you reacted thumbs up in this issue. Are you facing the same issue as @matt-cote? Could you kindly try azure/login@v1.6.0 to verify if it works to your issue?

@matt-cote
Copy link
Author

Hi @MoChilia, apologies for the delay. I was able to verify that v1.6.0 works with our use case. Thanks for addressing this issue!

@charlrvd
Copy link

It works for me too. Thanks

@MoChilia
Copy link
Member

Closing the issue, since this is fixed in v1.6.0 and v1 is pointed to v1.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants