After you install Azure CLI (on your Windows, Mac or Linux) you have everything you need to manage your Azure account. But in order to do so, first you need to login to your account with CLI. There are two ways to do so.
First way is to open CMD and write:
azure login
This will prompt you for your username and password. You enter your username, your password and you are good to go. But this is only possible if you have Azure AD in place and use your AD account to login. If you use any other type of account, you will not be able to login this way.
If you use this type of authentication, you will need to import your publishsettings and here are steps to do so.
Open your CMD and write :
azure account download
This will start your browser (or new tab if it’s already opened) and take you to Azure publishsettings page
After downloading publishsettings file you run following command:
azure account import ”location of your file”
After this, you are good to go and you can start managing your account.
There are few other things you can do with your account and subscriptions.
azure account list
This command will show available subscription on your account. In my case, I have two MSDN subscriptions and it shows both of them.
azure account show
This will show your active subscription. All commands will be executed on this sub. Any VM, service, website you create will be assigned to this subscription and billed to this subscription.
Also note that subscriptions are in fact separated and if you spend all credit on one subscription, services that use this subscription will be stopped for end of month. It will not automatically start using credit form other subscription(s) even you have credit on them. Services will be put in read-only mode till start of next billing period when you can start them again.
You can set active subscription for your session by running:
azure account set ”name of subscription”
Name of your subscription you can get by running azure account list
After this, all resources created will be associated with this subscription.
Interesting part with this type of authentication is that once you import yur settings file, you session stay active no matter what you do. You can close CMD window, restart or shut down, you session will stay active.
Only way to change this is to run
azure account clear
This will end your session and you will need to import your settings again.
So much for this time, hope it helped at least someone.
Comments are closed.