Azure CLI installation



  • As I'm writing this, I'm riding a train to work. I'm a bit bored, so I thought "I'll give Azure CLI a try - I like how the Powershell tooling works on Windows so it must be okay on macOS as well, right?"

    WRONG.

    Here's my installation experience so far:

    1. Install by piping the output of cURL to bash, :fa_check:
    2. Throwing gibberish at me and asking me questions that I don't care about, :fa_check:
    Alexs-MacBook-Air:~ alex$ sudo curl -L https://aka.ms/InstallAzureCli | bash
    Password:
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   167  100   167    0     0    112      0  0:00:01  0:00:01 --:--:--   112
    100  1367  100  1367    0     0    521      0  0:00:02  0:00:02 --:--:--  4633
    Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /var/folders/0_/kml08r6s0kq5lmygdzrvfpg00000gn/T/azure_cli_install_tmp_XXXX.55xR1Ejq.
    ######################################################################## 100.0%
    /var/folders/0_/kml08r6s0kq5lmygdzrvfpg00000gn/T/azure_cli_install_tmp_XXXX.55xR1Ejq: OK
    Running install script.
    -- Verifying Python version.
    -- Python version 2.7.10 okay.
    
    ===> In what directory would you like to place the install? (leave blank to use '/Users/alex/lib/azure-cli'): 
    -- Creating directory '/Users/alex/lib/azure-cli'.
    -- We will install at '/Users/alex/lib/azure-cli'.
    
    ===> In what directory would you like to place the 'az' executable? (leave blank to use '/Users/alex/bin'): 
    -- Creating directory '/Users/alex/bin'.
    -- The executable will be in '/Users/alex/bin'.
    
    1. Showing random popups, :fa_check:
      0_1499668553598_c5302295-0b81-4608-a435-69785dd57cec-image.png

    2. Erroring out without telling me what to do next, :fa_check:
      0_1499668464111_c7ddd776-2e82-4ef1-bc20-229188b504d8-image.png

    Good job, Microsoft, at staying true to the Open Source Experience :fa_trademark:.


  • Impossible Mission Players - A

    Fucking Python.



  • I've restarted the script and now it continues beyond where it broke the last time. Now it wants to know this:

    ===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): 
    

    What does this even mean :interrobang: Why is this a question? What if I say no, won't I then be able to use it?



  • ===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): n
    -- If you change your mind, add 'source /Users/alex/lib/azure-cli/az.completion' to your rc file and restart your shell to enable tab completion.
    -- You can run the CLI with '/Users/alex/bin/az'.
    -- Installation successful.
    -- Run the CLI with /Users/alex/bin/az --help
    

    What? Where is "your rc file"? How do I update it? How am I supposed to remember any of this?


  • Discourse touched me in a no-no place

    @alexmedia This command line looks really strange:

    sudo curl -L https://aka.ms/InstallAzureCli | bash
    

    The thing that is wrong? You're elevating the process that doesn't (well, damn well shouldn't!) need it, and not elevating the process that might well need it if it is doing stupid installation stuff. Even though I think that sudo bash is pretty bad too, at least it would make logical sense. A failure to elevate the right process might explain the later failures.

    I'd expect one of these to work better:

    Elevate the installation instruction processor

    curl -L https://aka.ms/InstallAzureCli | sudo bash
    

    Elevate ALL THE THINGS

    sudo bash -c 'curl -L https://aka.ms/InstallAzureCli | bash'
    

  • Winner of the 2016 Presidential Election

    @alexmedia said in Azure CLI installation:

    ===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): n
    -- If you change your mind, add 'source /Users/alex/lib/azure-cli/az.completion' to your rc file and restart your shell to enable tab completion.
    -- You can run the CLI with '/Users/alex/bin/az'.
    -- Installation successful.
    -- Run the CLI with /Users/alex/bin/az --help
    

    What? Where is "your rc file"? How do I update it? How am I supposed to remember any of this?

    Uuuuh, yeah, you should have said "Y"...

    If you don't know what PATH is... you should probably learn about that before you start playing around in CLI, cause that's kinda a core concept...


  • Winner of the 2016 Presidential Election

    @alexmedia said in Azure CLI installation:

    What if I say no, won't I then be able to use it?

    Basically, yea. It won't be on your $PATH, meaning you won't be able to use it without doing the full entire path to the executable any time you want to run it.

    So, instead of az -stuff you have to do /full/long/path/to/executable/az -stuff



  • @dkf I guess I haven't had enough coffee yet. When I reran the command I totally omitted the sudo and it finished installing just fine.

    @sloosecannon I know what PATH is, I just don't understand the question. Why does it bother asking in the first place? If it is that important, why doesn't it add itself to my $PATH by default and print a "for convenience I've added myself to your $PATH. You're welcome."?


  • Winner of the 2016 Presidential Election

    @alexmedia said in Azure CLI installation:

    why doesn't it add itself to my $PATH by default and print a "for convenience I've added myself to your $PATH. You're welcome."?

    Because idiots will complain about it... also, it could probably break for raisins, so they gave you the choice.

    0_1499670107753_aea79625-43b6-479e-b2ae-a1ab3c419f66-image.png

    (yes, I really wanted to use that image...)


  • Discourse touched me in a no-no place

    @sloosecannon said in Azure CLI installation:

    (yes, I really wanted to use that image...)

    And I really wanted to upvote you for using it!



  • @alexmedia said in Azure CLI installation:

    Why does it bother asking in the first place?

    Even many Windows software installers have a tickbox for "Add to PATH variable?" so it's a pretty common question. Not sure why you're worked up about being given a choice in the matter.


  • Impossible Mission Players - A

    @lb_ said in Azure CLI installation:

    @alexmedia said in Azure CLI installation:

    Why does it bother asking in the first place?

    Even many Windows software installers have a tickbox for "Add to PATH variable?" so it's a pretty common question. Not sure why you're worked up about being given a choice in the matter.

    0_1499672122936_7eeab111-5c9f-4b56-b6b0-cc09655f8fa0-image.png



  • @lb_ said in Azure CLI installation:

    Even many Windows software installers have a tickbox for "Add to PATH variable?" so it's a pretty common question. Not sure why you're worked up about being given a choice in the matter.

    I like to follow the "Don't make me think" principle. Give me sensible defaults, and give me an option to change them if I want to.

    Questions like "where do you want to install?" and "add to path?" will be answered with the defaults / Yes by approximately 95% of the users, so why even bother asking for input in the first place while you just as well might propose default values and only change them if the user explicitly asks you to.


  • Discourse touched me in a no-no place

    @alexmedia Ah, the “Express Installation” option.


  • Winner of the 2016 Presidential Election

    @alexmedia said in Azure CLI installation:

    you just as well might propose default values and only change them if the user explicitly asks you to.

    They did - you could have hit "Enter" and it would've chosen "Y" :)



  • @alexmedia said in Azure CLI installation:

    What? Where is "your rc file"? How do I update it? How am I supposed to remember any of this?

    It's standard bash stuff: ~/.bashrc. It's going to tell bash about its commands so that you'll get smart tab autocomplete. Like, bash will know about options or whether it should be looking for a file, or maybe even filter them somehow, depending on what you're doing (and how much they put into it).

    You definitely want it.


  • Winner of the 2016 Presidential Election

    @sloosecannon said in Azure CLI installation:

    If you don't know what PATH is... you should probably learn about that before you start playing around in CLI, cause that's kinda a core concept...

    Same for the RC file.



  • @asdf I don't know, I could definitely see knowing about PATH and not knowing about the rc file. I administer Linux servers and still would forget about it until reminded as I don't customize my shell typically.



  • @heterodox said in Azure CLI installation:

    I don't customize my shell typically.

    About the only thing I do is export EDITOR=nano.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.