12 ms·
Announcing Azure Command-Line Interface 2.0 Preview
- dajonker 10y agoOne 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 10y agoYeah, 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 10y ago"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-2-preview/ https://azure.microsoft.com/en-us/blog/announcing-azure-cli-...
- rcarmo 10y agoYep. 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).
- colemickens 10y agoOne 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.
- 0xFFC 10y agoPersonally 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 10y agoAll 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 10y agoThank 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 10y agoaws 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
- NeutronBoy 10y agoJust to complete your comparison, Azure has some great MS-based PaaS offerings (e.g. hosted DB, hosted IIS, etc) and great integration with MS environments, but I find their interfaces (API and portal) more clunky than AWS.
- Longhanks 10y agoDid they explain why they switched? Not that I'm complaining. Love Python, dislike JS being everywhere.
- WorldMaker 10y agoThere'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.
- jontro 10y agoLink to the motivation page: https://github.com/Azure/azure-cli/wiki/Motivation https://github.com/Azure/azure-cli/wiki/Motivation
- j1vms 10y ago> Basically (..) most distributions bundle Python but not Node. Also that AWS and Google CLI tools are still more Python than Node. Good ole' inveteracy. Unfortunately, it's really as good a reason as any when it comes to managing resources on a long-term project (people, time, $). Always needs to be balanced against using the right tool for the job, even if that means the initial pain of carrying a codebase written in a "relatively" newer language. To be clear, both Python and JS (NodeJS) are great tools with excellent communities and ecosystems.
- JasonRShaver 10y agoI 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".
- vram22 10y agoI had posted about GoogleCL (Python) a while ago, and some other related tools: http://jugad2.blogspot.in/2013/01/some-google-command-line-tools.html http://jugad2.blogspot.in/2013/01/some-google-command-line-t... My IBM developerWorks tutorial on writing command line utilities (C) is not at that IBM link in post now (archived after 10 years), but can be found here: http://jugad2.blogspot.in/2014/09/my-ibm-developerworks-article.html http://jugad2.blogspot.in/2014/09/my-ibm-developerworks-arti...
- robertocarlos 10y agoSurprised this is getting so much attention here. They re-wrote their CLI in another language. What's the big deal...
- andrewbinstock 10y agoAre 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 10y agoAnswers: https://github.com/Azure/azure-cli/wiki/Motivation https://github.com/Azure/azure-cli/wiki/Motivation
- itaysk 10y agoPersonally I find it interesting observing technology choices of large projects, thinking about if I started something similar, what should I choose...
- aikah 10y agoTech choices are always a big deal. Especially when they lead to rewrites.
- jpdlla 10y agoOfficial announcement in the Azure blog: https://azure.microsoft.com/en-us/blog/announcing-azure-cli-2-preview/ https://azure.microsoft.com/en-us/blog/announcing-azure-cli-...
- sctb 10y agoThanks, we updated the link from https://github.com/Azure/azure-cli https://github.com/Azure/azure-cli.
- bbayles 10y agoThe directory structure is beautiful.
- TranquilMarmot 10y agoCan'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 10y agothe 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.
- devy 10y agoFYI, 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/
- _jezell_ 10y agoWould have been better if they had rewritten in rust or go if they wanted to eliminate problems with distros...
- whyever 10y agoRust would actually be problematic with most distros.
- rwallace 10y agoWhy? What would be the source of problems?
- steveklabnik 10y agoThe big distros are starting to ship rustc and cargo in them, so apparently they don't think so.
- jimjimjim 10y agoThis 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...)
- bjt 10y agoBut wouldn't Python be just as suited for rapid development as Node, if not moreso?
- mhuffman 10y ago> 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.
- at-fates-hands 10y ago>> but by the same token, invited entire (and continuing) mountains of half-assed, unsupported(unsupportable) code that just begets generations of garbage. Isn't it possible to say this for just about every programming language?
- raverbashing 10y agoNot really The lower the barrier to entry, the more "inexperienced" people you get And with nodejs the inmates are running the asylum There is great nodejs code, for sure. But as left pad has shown us, it seems it is a big "Neverland"
- brachi 10y agoLooking at the Dockerfile, it seems this works in Python 3.5, that was the first thing I wanted to check when I read this.
- tetron 10y agoI 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 10y agoImproving 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
- int_19h 10y agoAlso, if you do scripting a lot, at some point you might want to go straight to the Python Azure management SDK (pip install --pre azure).
- sagivo 10y agomotivation: - 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 10y agoI 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.
- aabajian 10y agoPython 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).
- pm90 10y agoWhile I agree with the sentiment, I do still love the concise format of awk commands. Although arguably, they can get rather confusing when trying to do complex stuff.
- swalsh 10y agoI've been primarily a C# programmer for the majority of my career, with probably equal parts dabbling in Ruby, PHP, Javascript, Sql (large sprawling analytics framework sql), and a bit of R. When I switched to Ruby dev-work though, my tools changed. I found myself writing a lot more scripts for things which I previously would have made a C# console app for, mostly because osx/linux make it a lot easier. Soon I started writing a little Python, and found I was just plain productive (things that might have taken me many hours would take minutes), and now it's becoming a primary language for me. I'm not sure I'd use it for the majority of my work, but it's probably my #2 language tool.
- TheRealPomax 10y agoFunny. I know it, and still hate it. For every opinion that is held universally true, there is at least one person (but far more likely, many people) for whom that opinion is demonstrably false.
- labster 10y agoPython is a great language, but just not one that suits my mode of thinking. I learned Perl first, spent my time in college learning Python, C, Javascript, and FORTRAN 90 (at least the code that had been updated from F77), and eventually went back to Perl as I liked it the best. I could make a snarky comment about "you'll never go back" being correct, but I do make the occasional commit to a Python project. But honestly I'd rather deal with well-written PHP than well-written Python despite the fact that the Python language is -1 times better than PHP. Just the way my mind works.
- cmdrfred 10y agoLooks like the are going for both 2 and 3 support? https://github.com/Azure/azure-cli/blob/master/scripts/dev_setup.py https://github.com/Azure/azure-cli/blob/master/scripts/dev_s... EDIT: Nah, only 3. So much for Microsoft and it's legendary backwards compatibility. https://github.com/Azure/azure-cli/blob/master/scripts/generate_command_inventory.py https://github.com/Azure/azure-cli/blob/master/scripts/gener...
- dragonwriter 10y ago> 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 10y agoI was joking, I think it wasn't included accidentally. Also, if you want PyPy you are using Python2.
- tamalsaha001 10y agoI 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 10y agothere 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 10y agoIf 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 10y agoIt's amazing. I built my own little PaaS on it: https://github.com/rcarmo/piku https://github.com/rcarmo/piku
- TheRealPomax 10y agoCan 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?)
- lubos 10y agoI'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.
- smortaz 10y agoOn 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!
- phjordon 10y agoThis 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 10y agono event a mention on how to setup on windows
- itaysk 10y agoWas 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...
- eddd 10y agoPython 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.