login: Azure login takes ~ 3.50 minutes which is too long for simple login..

Below snippets hold the session for almost 4 minutes -

Run azure/login@v1
/usr/bin/az cloud set -n azurecloud
Done setting cloud: "azurecloud"
Running Azure PS Login
/usr/bin/pwsh -Command try ***
            $ErrorActionPreference = "Stop"
            $WarningPreference = "SilentlyContinue"
            $output = @***
            $data = Get-Module -Name Az.Accounts -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1
            $output['AzVersion'] = $data.Version.ToString()
            $output['Success'] = "true"
        ***
        catch ***
            $output['Error'] = $_.exception.Message
        ***
        return ConvertTo-Json $output
***
  "Success": "true",
  "AzVersion": "2.3.0"
***

It has probably happening because of $data = Get-Module -Name Az.Accounts -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1 .

May be we can use a container which already has Az module installed so it doesnt take that long to download Az.Account module?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 23 (6 by maintainers)

Most upvoted comments

I still experience this with login times spiking up to 3mins, and usually being in the range of 1min. Honestly, even 1min feels too long for a simple login (for us thats almost as long as time it takes for the actual deployment).