Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Azure CLI Day 3 – Account Set

DZone's Guide to

Azure CLI Day 3 – Account Set

· Cloud Zone
Free Resource

Linkerd, the open source service mesh for cloud native applications. Get the complete guide to using Linkerd and Kubernetes to build scalable, resilient applications.

In my previous post, I showed you how to import 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 set the context of an Azure command line session to use a specific subscription. Note, if you only have a single Windows Azure subscription, you don’t need to follow the steps in this post.

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 List

00 account list

The account with a Current value of true is the account whose services you can access during the current console session. In my case, the current account is set to Azdem194M85946L. I want to change this to the account called Microsoft DPE. To do so, I’ll start by copying the Id of the account. If you have multiple accounts, determine which account you want to set the current account to and copy its Id.

Next, you’ll want to execute the account set command. Start by typing the following:

Azure Account Set -h

01 account set h

This shows you how to use the command. In this case, you’ll need to provide the Id of the subscription you want to set to the current subscription. Enter the following command into the terminal:

Azure Account Set [ID OF YOUR SUBSCRIPTION]

02 account set

To verify the current subscription has changed, execute the following command:

Azure Account List

03 account list

Notice my current subscription has changed to Microsoft DPE. You should see a similar result in your console.

Now I’ll admit, these first few posts haven’t been too exciting, but I promise that is about to change – SOON! However, there is one more thing I need to cover: how to clear your account information from the command line. The reason we need to cover this is that if someone gets access to your console after you imported the .PUBLISHSETTINGS file, they can manage your Windows Azure services. I’ll show you how to remove account information from your console in my next post.

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

Linkerd, the open source service mesh for cloud native applications. Get the complete guide to using Linkerd and Kubernetes to build scalable, resilient applications.

Topics:

Published at DZone with permission of Adam Grocholski, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}