Cloud Zone is brought to you in partnership with:

Hey there! My name is Adam, and I'm a Technical Evangelist at Microsoft where I spend time focusing on Windows, Windows Phone, and Windows Azure. Adam is a DZone MVB and is not an employee of DZone and has posted 30 posts at DZone. You can read more from them at their website. View Full User Profile

Azure CLI Day 2 – Account Import

09.11.2013
| 1194 views |
  • submit to reddit

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:

rm [[PATH TO YOUR .PUBLISHSETTINGS FILE]]

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.

Published at DZone with permission of Adam Grocholski, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)