Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install azure cli in ostree environment #30683

Closed
frzifus opened this issue Jan 21, 2025 · 7 comments
Closed

Unable to install azure cli in ostree environment #30683

frzifus opened this issue Jan 21, 2025 · 7 comments
Assignees
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@frzifus
Copy link

frzifus commented Jan 21, 2025

Describe the bug

I followed the official installation guide. Installing azure cli similar to other packages:

Image

After a reboot, I can see the package got installed:

$ rpm -qa | grep -i "microsoft"
packages-microsoft-prod-1.0-1.noarch

Related command

Afterwards I am unable to find the cli script.

╭─     ~                                                                                                                                                                                               09:56:46
╰─❯ which az                                                                                                                            
/usr/bin/which: no az in (...)
╭─     ~                                                                                                                                                                                       ✘ 0|1   09:56:50
╰─❯ az       
zsh: command not found: az
╭─     ~                                                                                                                                                                                               09:56:56
╰─❯ ls /usr/bin/ | grep az
╭─     ~                                                                                                                                                                                       ✘ 0|1   09:56:59
╰─❯ 

Errors

None

Issue script & Debug output

The Installation seems to be successful.

Image

Expected behavior

Azure cli appears in filesystem.

Environment Summary

Installation failed.

Additional context

No response

@frzifus frzifus added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 21, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 21, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jan 21, 2025
@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Jan 21, 2025
@yonzhan yonzhan added this to the Backlog milestone Jan 21, 2025
@frzifus
Copy link
Author

frzifus commented Jan 21, 2025

Awesome, let me know if you need more infos.

Update
I tried to run the install script during my os-tree build:

FROM quay.io/fedora/fedora-silverblue:41
RUN curl -L https://aka.ms/InstallAzureCli -o /tmp/install_azure_cli.sh
RUN chmod +x /tmp/install_azure_cli.sh
RUN /tmp/install_azure_cli.sh

But that also seems not to work.

--> 0d32bf932a2d
STEP 6/15: RUN curl -L https://aka.ms/InstallAzureCli -o /tmp/install_azure_cli.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1405  100  1405    0     0   1588      0 --:--:-- --:--:-- --:--:--  8619
--> abf06282bb13
STEP 7/15: RUN chmod +x /tmp/install_azure_cli.sh
--> ede8dfa46533
STEP 8/15: RUN /tmp/install_azure_cli.sh
Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /tmp/azure_cli_install_tmp_Hu5FXr.
######################################################################## 100.0%
/tmp/azure_cli_install_tmp_Hu5FXr: OK
Running install script.
/tmp/install_azure_cli.sh: line 42: /dev/tty: No such device or address
Error: building at STEP "RUN /tmp/install_azure_cli.sh": while running runtime: exit status 1

Workaround
In case someone else runs into the same issue...

alias az=podman run --rm -it -v $HOME/.azure:/root/.azure:z mcr.microsoft.com/azure-cli az

@frzifus
Copy link
Author

frzifus commented Jan 21, 2025

Another Workaround

In case some other scripts need to access az, another workaround is to create an az script and place it in one of your $PATH locations.

#!/bin/bash

podman run --rm -it -v $HOME/.azure:/root/.azure:z -v ${PWD}:/current:z -w /current mcr.microsoft.com/azure-cli az "$@"

@bebound
Copy link
Contributor

bebound commented Jan 22, 2025

You don't provide the full Dockerfile. I'm confused, are you trying to use the RHEL guide to install azure-cli in Fedora?

We don't have an official build for Fedora, but there's a community version you can try.

@frzifus
Copy link
Author

frzifus commented Jan 22, 2025

Hi @bebound , I think that breaks it down the minimal image:

FROM quay.io/fedora/fedora-silverblue:41
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc
RUN rpm-ostree install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm

At the end you should end up with a bootable fedora:41 that has az installed.

I can confirm that the installation of the azure-cli works on a mutable fedora:41 system.
But I also can confirm it does not work on a RHEL:9.5 or Fedora:41 immutable system. [Image mode for RHEL Enterprise Linux]

@bebound
Copy link
Contributor

bebound commented Jan 24, 2025

I don't know about mutable or immutable Fedora, but at least RHEL 9 is supported.

  1. packages-microsoft-prod-1.0-1.noarch is not az package. Run dnf install azure-cli to install az.
  2. https://aka.ms/InstallAzureCli is deprecated.

@frzifus
Copy link
Author

frzifus commented Jan 27, 2025

I started using the fedora version of azure-cli. It throughts some error messages, but it works. Thanks for your help!

@frzifus frzifus closed this as completed Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants