Azure / login

Connect to Azure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

📢 Azure/login v2 Release Announcement

MoChilia opened this issue · comments

👀 What’s new in azure/login@v2?

⚠️ This is breaking change

To apply this change, please update the version of azure/login to v2 in your workflow files.

    - name: Azure Login
      uses: azure/login@v2
      with:
        client-id: ${{ secrets.AZURE_CLIENT_ID }}
        tenant-id: ${{ secrets.AZURE_TENANT_ID }}
        subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
        enable-AzPSSession: true

@MoChilia
One thing that I'm noticing with the update to azure/login@v2 is a warning concerning the Az version that doesn't happen with the azure/login@v1. It's just an informational warning that's output during the Pre Az CLI login and I wanted to bring this to your attention.
Clearing azure cli accounts from the local cache.

/usr/bin/az account clear
{
Result: '/usr/share/az_11.3.1/Az.Accounts/2.17.0/Az.Accounts.psd1',
Success: true
}
Clearing azure powershell accounts from the local cache.
/usr/bin/pwsh -Command Clear-AzContext -Scope Process
/usr/bin/pwsh -Command Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
WARNING: You're using Az version 11.3.1. The latest version of Az is 11.5.0. Upgrade your Az modules using the following commands:
Update-PSResource Az -WhatIf -- Simulate updating your Az modules.
Update-PSResource Az -- Update your Az modules.

@MoChilia One thing that I'm noticing with the update to azure/login@v2 is a warning concerning the Az version that doesn't happen with the azure/login@v1. It's just an informational warning that's output during the Pre Az CLI login and I wanted to bring this to your attention. Clearing azure cli accounts from the local cache.

/usr/bin/az account clear { Result: '/usr/share/az_11.3.1/Az.Accounts/2.17.0/Az.Accounts.psd1', Success: true } Clearing azure powershell accounts from the local cache. /usr/bin/pwsh -Command Clear-AzContext -Scope Process /usr/bin/pwsh -Command Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue WARNING: You're using Az version 11.3.1. The latest version of Az is 11.5.0. Upgrade your Az modules using the following commands: Update-PSResource Az -WhatIf -- Simulate updating your Az modules. Update-PSResource Az -- Update your Az modules.

@JimSuplizio, it's because the default Azure PowerShell version on the runner is not the latest. It's not related to the Azure Login Action release.

@MoChilia yes, but this warning wasn't happening on the v1 version, only the v2. I'm just bringing that to your attention.

@MoChilia can you please let me know if the v2 tag will be updated to be the same commit as v2.1.0. It's still v2.0.0.

Hi - could you confirm if the issue #403 is expected to be resolved in v2 ? We just tried a CICD workflow run with v2 and we still get the error message as specified in issue 403. i.e. We have concurrent jobs running with az login in both jobs, when one job finishes before another, the post clean up of credentials causes the other job to fail. Keep in mind both jobs run on the same self hosted runner.

@MoChilia can you please let me know if the v2 tag will be updated to be the same commit as v2.1.0. It's still v2.0.0.

Hi @mennlo, we've updated v2 to v2.1.0. Feel free to test it out now. Last week, we were testing the tag and awaiting customer feedback to ensure there are no issues with v2.1.0. Thanks for understanding.

Hi - could you confirm if the issue #403 is expected to be resolved in v2 ? We just tried a CICD workflow run with v2 and we still get the error message as specified in issue 403. i.e. We have concurrent jobs running with az login in both jobs, when one job finishes before another, the post clean up of credentials causes the other job to fail. Keep in mind both jobs run on the same self hosted runner.

Hi @ChamalGomesHSO, the issue with #403 is due to installing azure-cli within the job, which can cause failures in the pre cleanup step. This has been fixed since v1.6.1. Your issue seems to be unrelated to that.

It appears you have multiple runners on a single VM to run jobs in parallel, which can be risky. If you log in to different accounts in two jobs, you may switch to the wrong Azure account. We recommend using one single VM user per runner. For more details, see https://github.com/Azure/login?tab=readme-ov-file#security-hardening.

Would be nice to have these kind of announcements in a changelog file or something.

Screenshot 2024-05-10 at 14 15 52

I am facing this issue when trying to change to azure/login@v2

Any help please?

Hi @JackBruceShell, could you open a new issue with your sample workflow and runner configuration?

Hi @JackBruceShell, could you open a new issue with your sample workflow and runner configuration?

#442