Skip to content

Azure/login is slow to execute with Hosted Compute Networking #527

Description

@CpuID

Possibly related to any of these issues (some open, some closed):

#456
#449
actions/runner-images#10110


We're running Azure/login@v2 on Github-hosted Actions Runners using the Github provided/default Ubuntu 24.04 image.

It seems when using Hosted Compute Networking, the Azure/login@v2 action takes a long time to complete.

My first theory was "maybe there's an NSG rule doing something weird", but then when I saw just running an az version beforehand speeds things up so much, I feel like something else is at play?

Added context:

Any additional debugging steps that can be suggested would be appreciated - I can run further tests to try isolate the root cause with maintainer input.


Examples:

  • just running login, nothing else, 43-49 seconds
    • note the runs-on

Image

Image

on:
  push:
    branches:
      - main

permissions:
  id-token: write

jobs:
  azure-cli-startup:
    runs-on: ubuntu-latest-2core--azure-vnet
    steps:
      - name: Azure login
        uses: Azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          allow-no-subscriptions: true
  • if we run az version before a login, that drops to 7 seconds aggregate, 4 seconds for az version and 3 seconds for the login 🤯

Image

on:
  push:
    branches:
      - main

permissions:
  id-token: write

jobs:
  azure-cli-startup:
    runs-on: ubuntu-latest-2core--azure-vnet
    steps:
      - name: Run az version
        run: |
          az version

      - name: Azure login
        uses: Azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          allow-no-subscriptions: true
  • if we run this without Hosted Compute Networking, its a 5 second execution time
    • note the runs-on

Image

on:
  push:
    branches:
      - main

permissions:
  id-token: write

jobs:
  azure-cli-startup:
    runs-on: ubuntu-latest
    steps:
      - name: Azure login
        uses: Azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          allow-no-subscriptions: true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Azure CliFor Azure CLI issue.performance-issuePerformance improvement required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions