A few weeks ago, I published a blog about Windows Azure cloud services. I'm digging up new things and experimenting with mac,pc and Linux (I prefer Ubuntu). As a fan of PowerShell and command lines for a long time, I've been looking for ways to handle transactions in text mode, as well as the creation and deployment of script sites.
There was a whole bunch of ways to access Azure using the command line-more than I thought. There is a JSON based Web API that lets those tools terminate the conversation. If you want, you can certainly call those APIs directly, but the command-line tools are really interesting.
Windows PowerShell cmdlets Mac command-line tools Linux command line tools
You can install the Mac Azure SDK installer on your Mac to get these tools and more, or, if you install Node.js on Windows or Mac or Linux, you can use node Page Manager to install Azure like this:
NPM Install Azure--global
You can also use apt or other storage commands. After that, you can run "Azure", which provides a very intuitive way to provide links to your commands. "Azure topic (noun) verb options" or "Azure site list" or "Azure virtual hard disk creation", as follows:
There is even the art of ASCII, who can not like it.
Seriously, although it's a cliché. Here's an example of the interaction I just made. I cut some boring stuff, but it started with a whole new machine with no tools installed and ended up interacting with my Windows Azure account.
scott@hanselmac:~$ npm Install azure
npm http Get https://registry.npmjs.org/azure
... bunch of GETS ...
scott@hanselmac:~$ Azure
Info: _ _____ _ ___
Info:/_\ |_/| | | _ \ __|
Info: _ ___/_ \__//| |_| | / _|___ _ _
Info: (___/_/\_\/___|\___/|_|_\___| _____)
Info: (_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) _
Info: (______________ _) (___ _)
Info:
info:windows Azure:microsoft ' s Cloud Platform
Info:
Info:tool version 0.6.0
... bunch of help stuff ...
scott@hanselmac:~$ Azure Account Download
info:executing command Account download
Info:launching browser to http://go.microsoft.com/fwlink/?LinkId=254432
help:save The downloaded file, then execute the command
help:account Import <file>
info:account download Command OK
scott@hanselmac:~$ CD ~
scott@hanselmac:~$ CD downloads/
scott@hanselmac:~/downloads$ ls
3-month Free Trial.publishsettings
scott@hanselmac:~/downloads$ Azure Account Import 3-month\ free\ trial.publishsettings
info:executing Command Account import
info:setting Service Endpoint To:management.core.windows.net
info:setting Service Port to:443
info:found subscription:3-month Free Trial
info:setting Default Subscription to:3-month free Trial
Warn:remember to deletes it now, it super-delegates been imported.
Info:account Publish settings imported successfully
info:account Import Command OK
scott@hanselmac:~/downloads$ Azure Site List
info:executing command Site list
+ Enumerating Locations
+ Enumerating Sites
data:name State Host names
data:-------------------------------------------------------------------------------------
data:superawesome Running superawesome.azurewebsites.net,www.acustomdomain.com
info:site List command OK
scott@hanselmac:~/downloads$ Azure Site list--json
[
{
"adminenabled": "True",
"availabilitystate": "Normal",
"Enabledhostnames": [
"Superawesome.azurewebsites.net",
"Www.acustomdomain.com"
],
"hostnames": [
"Ratchetandthegeek.azurewebsites.net",
"Www.ratchetandthegeek.com"
"state": "Running",
"usagestate": "Normal",
"webspace": "Eastuswebspace"
}
]
Here's how I use the command line to create and start a virtual machine. First I'll list the available mirrors, I can start with those mirrors, and then I'll create it. I waited for it to be ready, and then started and prepared a remote connection (RDP,SSH, etc.).
scott@hanselmac:~$ Azure VM image list
info:executing command VM image list
+ Fetching VM Images
data:name Category OS
data:------------------------------------------------------------------------------------------
data:canonical__canonical-ubuntu-12-04-amd64-server-20120528.1.3-en-us-30gb.vhd CANONICAL Linux
data:msft__windows-server-2012-rc-june2012-en-us-30gb.vhd Microsoft Windows
data:msft__sql-server-11eval-11.0.2215.0-05152012-en-us-30gb.vhd Microsoft Windows
data:msft__win2k8r2sp1-120514-1520-141205-01-en-us-30gb.vhd Microsoft Windows
data:openlogic__openlogic-centos-62-20120531-en-us-30gb.vhd openlogic Linux
data:suse__opensuse-12-1-20120603-en-us-30gb.vhd SUSE Linux
data:suse__suse-linux-enterprise-server-11sp2-20120601-en-us-30gb.vhd SUSE Linux
INFO:VM image List command OK
scott@hanselmac:~$ Azure VM Create HANSELVM msft__windows-server-2012-rc-june2012-en-us-30gb.vhd Scott Superpassword- -location "West US"
info:executing command VM Create
+ looking up image
+ looking up cloud service
+ Creating cloud service
+ Retrieving storage accounts
+ Creating VM
INFO:VM create command OK
scott@hanselmac:~$ Azure VM list
info:executing command VM list
+ fetching VMs
data:dns name VM name Status
data:-----------------------------------------
data:hanselvm.cloudapp.net HANSELVM Provisioning
INFO:VM List command OK
This is a command-line tool for Mac,linux and optional windows. (If you install node and run "NPM install Azure--global"), there are also PowerShell commands used by Windows administrators. It's important to note that you can check out all the code because the Http://github.com/windowsazure on GitHub are open source. In fact, the entire command-line application is written in JavaScript.
Just as the command-line version of the management tool has a very specific and comfortable style of noun/verb/option, comdlets is also very "powershelly" style and makes it very comfortable for people who use PowerShell. Documents and tools are in the preview mode and are being developed, so you'll find vulnerabilities in your documents.
These PowerShell commands can work together and the data is transmitted between them. A new Azure virtual machine configuration is created here, and its machine name is selected from the list, and the Config object is passed to the NEW-AZUREVM.
1:c:\ps>new-azurevmconfig-name "MySUSEVM2"-instancesize extrasmall-imagename (Get-azurevmimage) [7]. ImageName '
2: | Add-azureprovisioningconfig–linux–linuxuser $lxUser-password $adminPassword '
3: | New-azurevm
Next, I want to find out how to start an entire farm site with the command line, how to deploy an application to a new network farm, configure traffic for the farm, and then load the tests frequently, which are obtained using the command line. How interesting it will be!
Sponsor: I want to thank my colleagues who sponsored the DevExpress this week. It's great to look at their dxperience tools. You can create a web-based ipad application using asp.net and Web forms. I am personally very impressed. DevExpress introduced DXperience 12.1-the technology environment is changing and new platforms are emerging. The new DevExpress tool provides the next-generation user experience on the desktop, on the web, or across a wide range of touch mobile devices.