
Announcing Azure Command-Line Interface 2.0 Preview - itaysk
https://azure.microsoft.com/en-us/blog/announcing-azure-cli-2-preview/
======
jimjimjim
This reminds me of companies rewriting applications from VB to c++/c#.

Half the people complained about VB being good enough and more popular.

But the overall feeling was that once the rapid application dev version is out
the door and ok then it's a good time to redo it with something more
engineering-y, for long term support before the first version gets too
ossified.

(i'm sure i'm going to burn karma for comparing node with vb but...)

~~~
mhuffman
> i'm sure i'm going to burn karma for comparing node with vb but...

I'll take the hit for you and flat-out say that node.js is the new VB.

In fact, for those of you that have been around a while, I think we can all
agree that node.js is the new PHP was the new Visual Basic, etc.

Not in the sense that they do the same things, but that they were purposely
built for non-programmers (baby-devs) to be able to program (which is good!)
but by the same token, invited entire (and continuing) mountains of half-
assed, unsupported(unsupportable) code that just begets generations of
garbage.

If you are a consultant, fixing this garbage can be a whole career.

~~~
arisAlexis
Seems like javascript is picked up by giants (microsoft build its IDE)
facebook (React?) Google (angular) so I guess you cant compare it with VB
unlesss I missed something in the 90s

~~~
mhuffman
Oh boy did you miss something in the 90s! It was call active pages (or some
bullshit, I have tried to block it from my memory) and it made Internet
Explorer the king of browsers and still locks in a lot of government agencies
and business from upgrading their infrastructure, because they don't want to
lose or have to pay to redevelop "critical" applications to their daily work.

~~~
cbhl
ActiveX?

[https://en.wikipedia.org/wiki/ActiveX](https://en.wikipedia.org/wiki/ActiveX)

~~~
programmer_man
No, this:
[https://en.wikipedia.org/wiki/Active_Desktop](https://en.wikipedia.org/wiki/Active_Desktop)

Kind of related, it was a COM control you could stretch over your whole
desktop, that received push notifications.

Also, I believe it was TOTALLY secure.

Edit: Dang it, I missed where they said "and it made ie the king of browsers."
\-- Yes, ActiveX

~~~
cbhl
I was 8 when Active Desktop came out -- I used it to put Neopets on the
desktop of my computer.

------
sagivo
motivation:

 _\- Dependency management for Node.js adds maintenance costs for Linux
distributions.

\- Cloud tooling vendors prefer Python to match AWS CLI and GCloud CLI.

\- Python offers a more mature platform for building CLIs Python is typically
available on Linux distributions by default.

\- While none of these reasons precluded building the next CLI in Node.js,
Python was the natural choice._

taken from here - [https://github.com/Azure/azure-
cli/wiki/Motivation](https://github.com/Azure/azure-cli/wiki/Motivation)

~~~
robbyt
I think Golang would have been a better choice. They already have a fairly
mature Go SDK, and redistribution of Go binaries is so much easier.

------
lubos
I'm currently starting one project on Node.js and just this morning I thought
to myself. This is too hard. I might as well rewrite it in Python.

The main issue for me is how Node.js is forcing you to have all I/O operations
asynchronous. For what I'm doing, this is exactly what I don't need. It makes
the code so much more complicated. It's callback into callback into callback
and returning "promises" within "promises"... simple functions are turned into
beasts. It works but it's obvious I'm not using the right tool for the job.

Don't get me wrong. I'm actually glad I dived into Node.js and learned a lot
of new things. It's just that Node.js is very specialized framework which is
amazing for certain use-cases and totally inappropriate for others.

On the other hand, Python is general-purpose. It's never the best tool for the
job but it's almost always good enough. So once you know Python, you know you
can use it in many diverse projects without giving up your sanity. Can't say
the same about Node.js.

------
Longhanks
Did they explain why they switched?

Not that I'm complaining. Love Python, dislike JS being everywhere.

~~~
WorldMaker
There's a mention of it in the "Motivation" page on the GitHub wiki. Basically
the big thing seems to be the feedback from Linux users that most
distributions bundle Python but not Node. Also that AWS and Google CLI tools
are still more Python than Node.

~~~
JasonRShaver
I am the author of the Motivation page; the choice of language was really
focused on what's best for partners and customers; I believe either language
could have "done the job".

------
dajonker
One advantage of using a dynamic language like Python is that you don't
necessarily have to update the client code to be able to use new functions.
You can just generate the necessary code during runtime after loading the
specification from a web API. I believe this is what google does with their
gcloud tools (and that's probably also the reason why it sometimes feels slow
to react). Yes, you can probably do this using Node as well, but Python comes
installed on a lot of Unix based systems nowadays, as far as I can tell Node
does not.

~~~
STRML
Yeah, absolutely no reason you couldn't do this (quickly) with Node. The only
reason I see to use Python over Node here is for a smaller dep tree (sane Node
development still requires a lot of dependencies) and some more mature CLI
libraries - _lots_ of CLI apps are written in Python.

~~~
pjmlp
"have also heard, especially from customers working with Linux, about our
XPlat CLI and its poor integration with popular Linux command-line tools as
well as difficulties with installing and maintaining the Node environment"

[https://azure.microsoft.com/en-us/blog/announcing-azure-
cli-...](https://azure.microsoft.com/en-us/blog/announcing-azure-
cli-2-preview/)

~~~
rcarmo
Yep. This. I know it's not cool to point this out and that front-end folks
upgrade Node all the time, but installing Node on a "normal" machine inside
your average IT environment is a complete pain, whereas you can do pip install
azure-cli as a regular user without installing anything else on most Linux
distros out of the box.

Also, I've had nothing but trouble with recent Node versions (and I'm a
pyenv/rbenv/*env/etc. guy, have multiple runtimes of everything around, etc. -
but most people would try once and never try again).

------
aabajian
Python is the language that, once you know it, you'll never go back. It's
gotten to the point where I use it to run an entire backend as well as simple
terminal scripts. It's faster to write a Python script to "switch the first
and third columns in a file", rather than Googling for an appropriate awk
command (or spending the time to come up with one myself).

~~~
blitzd
I know python fairly well, and had previously done most web development with
flask or django. I had to learn JS so that I could do front end web dev,
things like D3 and such for visualizations of data. I tried out a few of the
frameworks that I came across for back-end web dev as well, things like Koa,
knex, passport, etc - and I have to say that these days I start far more
projects as JS/Node.JS projects than I do python.

I still love and use python quite often, but more in data
analysis/manipulation projects with Jupyter - Node definitely doesn't have
anything on python in that dept.

p.s., check out pandas if you're not already familiar with it.

~~~
gaius
_had to learn JS so that I could do front end web dev, things like D3 and such
for visualizations of data_

If you need to visualize from Python without touching JS try
[http://bokeh.pydata.org/en/latest/](http://bokeh.pydata.org/en/latest/)

------
devy
FYI, both AWS's CLI[1] and GCP's Cloud SDK(which includes CLIs like gcloud,
gsutil, bq, etc.)[2] are also written in Python.

[1]: [https://github.com/aws/aws-cli](https://github.com/aws/aws-cli)

[2]: [https://cloud.google.com/sdk/](https://cloud.google.com/sdk/)

------
tamalsaha001
I wish they had used GO. If you worry about distribution and dependencies, GO
static binaries are clear winner. One issue with GO binaries is that they can
become very big.

~~~
edsouza
there is this project:

[https://github.com/Azure/azure-sdk-for-go](https://github.com/Azure/azure-
sdk-for-go)

Azure is mostly a lot of REST apis.

------
johnwheeler
If you're going to write any sort of cli in Python, you really should use
click [http://click.pocoo.org/5/](http://click.pocoo.org/5/)

Why click? [http://click.pocoo.org/dev/why/](http://click.pocoo.org/dev/why/)

~~~
rcarmo
It's amazing. I built my own little PaaS on it:

[https://github.com/rcarmo/piku](https://github.com/rcarmo/piku)

------
brachi
Looking at the Dockerfile, it seems this works in Python 3.5, that was the
first thing I wanted to check when I read this.

------
smortaz
On behalf of the Python team @ Microsoft:

[http://imgur.com/gallery/MWcxIMA](http://imgur.com/gallery/MWcxIMA)

Congrats!

Python built into Windows 10, Azure CLI in Python, Python Tools for Visual
Studio, Azure Jupyter Notebooks, ... exciting times for Python devs on the
msft stack!

~~~
itaysk
> Python built into Windows 10

I'm on 10 and I had to install it.. Am I missing something?

~~~
rcarmo
It's part of Bash for Windows, but you're right, it's not on the Windows side
by default.

------
colemickens
One feature I'm loving in the new Azure CLI is a new command (`az ad sp
create-for-rbac`) that will create a new Service Principal and grant it a RBAC
Role assignment in a single shot. It should make the first step of setting up
CI/CD scenarios a bit easier.

~~~
rcarmo
Wow. I've been using it for a few weeks and never spotted that (been focusing
on infra). Thanks for the heads up.

------
phjordon
This is really cool! Some rambly notes:

* I'm interested in seeing how they plan on handling keeping an 'evergreen' state on ubuntu repos that they don't control.

* jmespath! It's great to see it spread more! Such a useful spec.

* There's an awful lot of dependencies, 59 vs 10 in the aws cli.

* No windows installers?

* Does that server side completion cost money?

* With such a crazy file structure, it would be great to see a getting started guide for contributing.

* The readme should really list the supported python versions.

* It's hard to tell how much is code generated and how much is custom.

* Help text prints right to the shell without using a pager.

~~~
itaysk
no event a mention on how to setup on windows

------
tetron
I haven't used the new Azure cli, but a major issue with the node.js based cli
was that it was heavily oriented towards interactive use and not well suited
for use by scripts. Hard to parse output, prompt for parameters instead of
accepting them on the command line, etc.

~~~
JasonRShaver
Improving the automation experience was a core goal of our new CLI effort.

If you (or anyone else) has any feedback on places we can improve, we are
happy to hear it (azfeedback [at] microsoft.com]).

Jason - Microsoft Azure CLI

------
itaysk
Was the submission edited?? The point I wanted to make was about the choice of
language, rather then the announcement of the new tools. It's kind of rude
TBH...

------
0xFFC
Personally I don't have any experience with working with neither of
AWS,Azure,GCP,etc.

But I am so curious to know how people who have worked with them find them?
Which one is better ? What is advantage of each one?

I couldn't find any useful information in web either.

Update: I am familiar with basic stuff. But I am so curious about heavy load,
for example why Spotify chose gcp or etc. Was there technical reason or it was
preference.

~~~
thesandlord
All of these platforms offer a free trial and a lot of products have free
tiers. I'd check them out and decide for yourself.

(I work for Google Cloud and am happy to answer questions about GCP)

~~~
0xFFC
Thank you , but what I meant was in heavy work load. I know the basic ideas.
But I am curious in heavy work load which one is preferred for what. AFAIK
Spotify went with GCP, many big companies went with azure, most startups chose
AWS.

What was the reason behind these, personal preference? Or technical
superiority?

The reason for my curiosity is Microsoft and Oracle kind of sees Cloud
Computing as life and death situation.

~~~
querulous
aws generally has the most features but clunky apis and high costs

gce has really nice apis but limited features and unless you do things like
google you'll have to do a lot of your own integration work

i've never seriously used azure

~~~
vgt
I'm genuinely curious on what limitations you've seen with Google's Cloud.

Google Compute Engine alone has lots of nifty features that even AWS EC2
lacks, like custom VMs, generalized VM types (no need to go for specific
instances to get fast networking, for example), preemptible VMs, live
migration, disk hot-grow, and sustained use discounts, while generally being
cheaper.

(work on GCP)

------
bbayles
The directory structure is beautiful.

~~~
TranquilMarmot
Can't tell if you're kidding or not... I ended up at

azure-cli/src/azure-cli-core/azure/cli/core/

That's.... definitely not beautiful

~~~
SysArchitect
the src directories, and command_modules directory inside of that all contain
separate Python projects. This allows them for instance to make
changes/updates to particular parts of the azure-cli but without releasing a
new version for each small sub-part.

Instead they could have created 17+ github repo's and had each part have it's
own repo... instead it's now all contained in a single place.

------
eddd
Python is a good fit for CLI tools, but it doesnt differ that much from node
when it comes to complex backends.

Type annotations in py3 might change that, but lets be honest - py3 is still
far from broad adoption.

------
TheRealPomax
Can someone please explain why the fact that it was in Node and is now in
Python matters in the slightest, given that it's a command line utility that
doesn't seem to, in any way, expose the language it is written in?

This could be in haskell or F# and it still wouldn't matter because it's the
CLI itself that matters. (to which the question must be: is Azure popular? Is
a new version of the CLI utility big news?)

------
jpdlla
Official announcement in the Azure blog: [https://azure.microsoft.com/en-
us/blog/announcing-azure-cli-...](https://azure.microsoft.com/en-
us/blog/announcing-azure-cli-2-preview/)

~~~
sctb
Thanks, we updated the link from [https://github.com/Azure/azure-
cli](https://github.com/Azure/azure-cli).

------
robertocarlos
Surprised this is getting so much attention here. They re-wrote their CLI in
another language. What's the big deal...

~~~
andrewbinstock
Are you not interested in why they rewrote it and what made them choose
Python? Did they have a problem with it in JS that JS could not solve? Lots of
interesting questions here.

~~~
WallowC_33
Answers:

[https://github.com/Azure/azure-
cli/wiki/Motivation](https://github.com/Azure/azure-cli/wiki/Motivation)

------
_jezell_
Would have been better if they had rewritten in rust or go if they wanted to
eliminate problems with distros...

~~~
whyever
Rust would actually be problematic with most distros.

~~~
rwallace
Why? What would be the source of problems?

------
cmdrfred
Looks like the are going for both 2 and 3 support?

[https://github.com/Azure/azure-
cli/blob/master/scripts/dev_s...](https://github.com/Azure/azure-
cli/blob/master/scripts/dev_setup.py)

EDIT:

Nah, only 3. So much for Microsoft and it's legendary backwards compatibility.

[https://github.com/Azure/azure-
cli/blob/master/scripts/gener...](https://github.com/Azure/azure-
cli/blob/master/scripts/generate_command_inventory.py)

~~~
dragonwriter
> Nah, only 3. So much for Microsoft and it's legendary backwards
> compatibility.

Microsoft tends to build tools that are backward compatible with earlier
versions of the same tools; it doesn't particularly tend to build tools that
are compatible with outdated versions of the platforms they are implemented on
top of, though.

~~~
cmdrfred
I was joking, I think it wasn't included accidentally. Also, if you want PyPy
you are using Python2.

