Skip to content

Support for profile value either in stack credentials or git actions input #534

Closed

Description

we are facing below issue related to azure stack login.

az cloud register: '2019-03-01-hybrid' is not a valid value for '--profile'. Allowed values: latest.

Following is our workflow:

      - name: run powershell scipt
        shell: pwsh
        run: Install-Module -Name Az -Repository PSGallery -Force

      - name: Login to Azure Stack
        uses: azure/login@v2
        with:
          creds: ${{ secrets.AZURE_STACK_CREDENTIALS }}
          environment: 'AzureStack'
          enable-AzPSSession: true

This behavior breaks our existing GitHub Actions workflows and scripts that rely on the '2019-03-01-hybrid' profile, which was previously supported.

Upon investigation, we found that the latest Azure CLI version only allows latest as a valid value for the --profile parameter.

Impact:
This change blocks our deployment pipelines that depend on hybrid cloud configurations. We would appreciate guidance on how to proceed or whether support for this profile can be reinstated.

Environment:
OS: Ubuntu 22.04
GitHub Actions runner: (self-hosted based on ubuntu-latest)

Activity

  1. added
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    Azure CliFor Azure CLI issue.
    and removed
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Jun 4, 2025
  2. MoChilia commented on Jun 4, 2025

    @MoChilia
    Member

    Hi Naveen Dharnamoni (@naveendharnamoni), that’s correct. According to https://learn.microsoft.com/en-us/cli/azure/whats-new-overview?view=azure-cli-latest#important-notice-for-azure-stack-hub-customers, Azure CLI versions newer than 2.66.x no longer support Azure Stack Hub.

    If you're using Azure Stack Hub, do not upgrade Azure CLI beyond version 2.66.x. To ensure compatibility, use Azure CLI version 2.66.x (LTS).

    We may remove Azure Stack support from the Azure Login action. As a workaround, you can run az login and other Azure CLI commands using the azure/cli@v2 action. For details, see https://github.com/Azure/cli. For example:

    - name: Azure CLI script
          uses: azure/cli@v2
          with:
            azcliversion: 2.66.0
            inlineScript: |
              az cloud register --name AzureStack  # Add more required arguments, please refer to https://learn.microsoft.com/en-us/cli/azure/cloud?view=azure-cli-latest#az-cloud-register for more details and specific config options
              az cloud set --name AzureStack
              az cloud show
              oidc_token=$(curl -s -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r '.value')
              az login --service-principal --username ${{ secrets.AZURE_PPE_CLIENT_ID }} --tenant ${{ secrets.AZURE_PPE_TENANT_ID }} --federated-token $oidc_token
              az account show
              # Add more Azure CLI commands here
  3. naveendharnamoni commented on Jun 5, 2025

    @naveendharnamoni
    Author

    This helps. Thanks Shiying Chen (@MoChilia)

  4. YanaXu commented on Jun 9, 2025

    @YanaXu
    Contributor

    Naveen Dharnamoni (@naveendharnamoni), may I ask which client tool are you using after Azure Login Action? Azure CLI or Azure PowerShell?

  5. MaddyMicrosoft commented on Aug 20, 2026

    @MaddyMicrosoft
    Member

    Azure CLI versions newer than 2.66.x no longer support Azure Stack Hub, so the 2019-03-01-hybrid profile is no longer a valid --profile value (only latest is accepted). This is an upstream Azure CLI change that azure/login can't override. Azure Stack Hub customers should pin Azure CLI to 2.66.x (LTS): https://learn.microsoft.com/en-us/cli/azure/whats-new-overview?view=azure-cli-latest#important-notice-for-azure-stack-hub-customers

    The workaround above using azure/cli@v2 with azcliversion: 2.66.0 covers this. Closing as resolved, please comment if you're still blocked and we'll reopen.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions