Get Up to Speed with Azure Command-Line Tools for Mac and Linux V0.6.7
A new version of the Windows Azure Command-line Tools for Mac and Linux has been released. This version adds some useful commands for working with Windows Azure Web Sites, specifically setting app settings and working with GitHub and the server side repository.
App settings is a feature of Windows Azure Web Sites, which lets you create key/value pairs that end up as environment variables at runtime. We've written about previously. But it required you to set the key/value pairs using the Windows Azure portal. Now you can control app settings from the command-line by using the following command:
azure site config add <key>=<value>
To see a list of all key/value pairs, use the following:
azure site config list
Or if you know the key and want to see the value, you can use:
azure site config get <key>
Now, what if you want to change the value of an existing key? Unfortunately, just adding it again doesn't work since it already exists. You must first clear the existing key and then re-add it. The clear command is:
azure site config clear <key>
To see the help listing for these commands, just use:
azure site config
One of the features added to the Windows Azure Portal a month or two back was to enable continuous deployment from GitHub, CodePlex, or Bitbucket, but this had to be done through the portal. Now you can use the following command to enable continuous deployment from GitHub:
azure site deployment github
You'll be prompted for your GitHub username and password, and then a list of the repositories you have access to. Once you select a repository, a new website hook will be created on GitHub for your Azure web site. New updates to the repository on GitHub will automatically be deployed to the Windows Azure Web Site. This will default to the master branch.
If you want to use a different branch than master, you can use the following command to specify the branch:
azure site repository <branchname>
There's another 'repository' command that's new also, which lets you completely remove a repository from your Windows Azure Web Site:
azure site repository delete
Web Site general
There's also a new general web site command, which will recycle a web site:
azure site restart
Issuing this will stop, and then restart the web site.
Getting the new bits
Since the command-line tools are implemented using Node, you can use npm to get the new bits. Use the following command to install the command-line tools:
npm install azure -g
This should install version 0.6.7 of the tools, which is the new version as of this post.
That's it for the new commands in the Windows Azure Command-line tools. There's also some updates to the Windows Azure PowerShell cmdlets, but I'll leave that post for Brian. For more information on using the Windows Azure Command-Line Tools for Mac and Linux, see http://www.windowsazure.com/en-us/develop/php/how-to-guides/command-line-tools/.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)