Over a million developers have joined DZone.

Azure CLI Day 2 – Account Import

DZone 's Guide to

Azure CLI Day 2 – Account Import

· Cloud Zone ·
Free Resource

In my previous post (http://thinkfirstcodelater.com/blog/?p=2966), I showed you how to download your Windows Azure account information, also known as your publishing settings, using the Windows Azure command line tools. In this post, I’ll show you how to import these settings into the command line.

Bash azure

Once again, just a reminder that I’m using the command line tools on a MacBook Air with OSX (Mountain Lion) installed, and I’m using Google Chrome as my default browser. However, the experience should be identical on Windows and Linux as well.

The first thing you’ll need to do is open an instance of your command line (Terminal, Bash, Command Prompt, etc.) and type the following:

azure account import -h

00 account import h

This simply shows you the usage of the command. In this case, there isn’t much to see. Find the location of the .PUBLISHSETTINGS file you download. If you don’t know what a .PUBLISHSETTINGS file is, or you haven’t downloaded one, please refer to my previous post (http://thinkfirstcodelater.com/blog/?p=2966). The next thing to do is to invoke the command with the following:

azure account import [[PATH TO YOUR .PUBLISHSETTINGS FILE]]

01 account import

Once the import completes, type the following into the terminal to see a list of your accounts:

acute account list

02 account list

As you can see from above, I happen to have three Windows Azure subscriptions associated with my Microsoft account. If you happen to be like me and have multiple accounts, I’ll show you how to use a specific account with the command line tools in my next post.

Although the account settings have been successfully imported, there is one more thing to do. The .PUBLISHSETTINGS file contains sensitive information. If someone else gets your file, that person will be able to control your Azure services. To prevent this from happening be sure to delete your .PUBLISHSETTINGS file. In a Mac terminal, issue the following command:


03 delete file

That’s it! You can now take control of your Windows Azure subscriptions.

Did you know you can try Windows Azure for free for 30 days? Just go to http://aka.ms/thecloud and sign up.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}