question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

azure/login@v1 and azure/CLI@v1 should be consistent

See original GitHub issue

Please align azure/login@v1 and azure/CLI@v1. It’s really strange and not user friendly.

Given workflow where I first use azure/CLI@v1 to show current az version and then use azure/login@v1 it behaves quite weird.

az version actually shows latest version because this action actually pulls and runs microsoft docker image with azure cli, but then the azure/login@v1 action fails because this one relies on az command being installed on self-hosted github runner.

    - name: show az version
      uses: azure/CLI@v1
      with:
        inlineScript: |
          az version

    - uses: azure/login@v1
      with:
        creds: ${{ secrets.SECRET }}

In my case the azure/login@v1 will fail on az command not being available because my runners are quite clean and az is not installed.

What is the reason to forcing users to both manage az on the hosts and also require having docker installed and pull docker images for actually performing any az actions?

I believe azure/login and azure/cli should use consistent approach in this case.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:10

github_iconTop GitHub Comments

8reactions
jludvicecommented, Apr 22, 2021

Example of az login failure when az is not installed on linux github self-hosted runner.

Run azure/login@v1
  with:
    creds: ***
    enable-AzPSSession: false
    environment: azurecloud
    allow-no-subscriptions: false
  env:
    NOT_RELEVANT: "..."

Error: Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows
Error: Error: Unable to locate executable file: az. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
1reaction
davetapleycommented, Dec 28, 2021

I just lost an hour because of the Please check the credentials. message, when in reality it was just that the act runner I was using didn’t have az installed 😞

Even if we can’t get self installing, can we at least check for az and abort with a clearer error message? I think it’s as simple as checking catching here: https://github.com/Azure/login/blob/db989b30605ff229e9f1de292a8f0aa043ee48b1/src/main.ts#L44

Because which says:

If you check and the tool does not exist, it will throw.

Which currently gets caught by this catch all whose error message doesn’t actually check the error 🤢 : https://github.com/Azure/login/blob/db989b30605ff229e9f1de292a8f0aa043ee48b1/src/main.ts#L209-L211

Read more comments on GitHub >

github_iconTop Results From Across the Web

Login consistently takes 30s-60s to complete #20 - GitHub
az login 27s (UP TO 60 seconds) Login successful. Run azure/login@v1 C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft ...
Read more >
Use the Azure login action with Azure CLI and PowerShell on ...
Use the Azure login action with Azure CLI and PowerShell to create a continuous integration, continuous deployment (CI/CD) workflow on Azure ...
Read more >
Release notes & updates – Azure CLI - Microsoft Learn
Learn about the latest Azure Command-Line Interface (CLI) release notes and updates for both the current and beta versions of the CLI.
Read more >
Sign in with Azure CLI — Login and Authentication
Learn the different authentication types for your Azure CLI login — sign in with Azure CLI automatically, locally, or interactively using ...
Read more >
Tips for using the Azure CLI successfully - Microsoft Learn
JSON gives you the most comprehensive information. This format is the default but you can use the --output parameter to specify a different ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found