Menu

Skip to content
  • About
  • Non-Tech
  • Tech

mukesh notes

Notes on Technology, Knowledge, Profession & Personal Lessons Learnt.

Tag Archives: Azure Profile

01.04.17
by mukeshshende

Login to Azure PowerShell Options

As you start doing anything advanced in Microsoft Azure you will need to use Microsoft’s PowerShell often. There are multiple ways you can login to Azure using PowerShell. In post I am only showing the new ways with resource management not the classic service management.

Option 1 : Log in to Azure with Login-AzureRmAccount

PS C:\> Login-AzureRmAccount

login-azurermaccount1

When I run Login-AzureRmAccount, I see a dialog like the one below, asking for credentials:

login-azurermaccount2

With successful login you can see the output

login-azurermaccount3

With this method you always have to enter your credentials before you start working with Azure cmdlets. This may be inconvenient if you work with multiple subscriptions.

Option 2 : Saving credentials with Save-AzureRmProfile

Make sure you are log in first

PS C:\> Login-AzureRmAccount
PS C:\> Save-AzureRmProfile -Path “C:\Folder\AzureProfile.JSON”

save-azurermprofile

This will create the file AzureProfile.json, which contains all the login information for your Azure account.

Important Note: This file is a plain-text JSON file. If an unauthorized person gains access to this file, it would compromise your Azure account, and this person could use Azure resources on your costs.

Now you can login with this profile by just selecting the profile.

PS C:\> Select-AzureRmProfile -Path “C:\Folder\AzureProfile.JSON”

select-azurermprofile

Since profile is tied up with subscription, you can work with only one profile at a time. If you want to work with multiple subscriptions simultaneously, you will need to save and select another profile.

Option 3 : Using PowerShell Profile

You can choose this while balancing security against convenience. Add following two lines of code into you PowerShell Profile.

$azCred = Get-Credential -UserName AzureAccount@YourDomain.onmicrosoft.com -message "Enter Password For AzureAdmin"
Login-AzureRmAccount -Credential $azCred

get-credentialpsprofile

It will prompt only for password for your azure account and login.

get-credentialpsprofilelaunch

get-credentialpsprofileoutput

Now start using Azure commands.

get-azurermresourcegroup

That’s it.

Rate this:

Standard | Posted in Azure PowerShell, PowerShell | Tagged Azure Login, Azure PowerShell, Azure Profile, PowerShell Profile | 1 Comment

Connect

  • Twitter
  • Linkedin
Follow mukesh notes on WordPress.com

Categories

  • AWS PowerShell (2)
  • Azure PowerShell (3)
  • Career (1)
  • Data Modeling (1)
  • Data Science (3)
  • Data Visualization (1)
  • Knowledge (17)
  • Life Experiences (4)
  • PowerShell (12)
  • Python (1)
  • R (1)
  • Reading (1)
  • SharePoint (2)
  • Thoughts (3)
  • Ubuntu (2)
  • Uncategorized (2)
  • VSCode (1)

Tags

App Authentication Approaching Artificial Intelligence Automating Automation AWSCredentials AWSDefaults AWS PowerShell Azure AD Azure Login Azure PowerShell Azure Profile Big Data Connected Content Delivery Data Modeling Data Science Data Science;Data Visualization Data Scrapping Devices Dimentional Data Model Discovering Download Files Experiences Faceted Navigation Groups Guru Hadoop Help-Learn HTML Infographic Internet of Things Invoke-WebRequest IoT Javascript Knowledge Sharing Learning Lessons Learnt Life Experiences Linux Machine Learning MindMap OAuth Odata PMIisms PMP PowerShell PowerShell ISE PowerShell Profile Profession Python R RegisteredAccounts.json Relational Data Model Resume Revision Roles Scientist Share-Knowledge SharePoint Solving Technical Problems Start-BitsTransfer StoredAWSCredentials StoredAWSRegion Teacher Terminal Thank You Ubuntu 14.04 Users Visuals Visual Studio Code Windows Administration Word 2013 Workflow Manager Year in Review

Blog Stats

  • 16,728 hits

Top Posts & Pages

  • मनुस्मृती विरुद्ध संविधान?
  • Tech
  • Non-Tech
  • Independence and *WE* kas
  • समाज म्हणजे काय?
  • Data Science Glossary
  • Replicate VS Code Extensions Using PowerShell
  • How do I practice PowerShell?
  • Download Ubuntu ISO using PowerShell
  • Unattended Ubuntu 16.04 Setup using PowerShell

My Earlier Notes

July 2022
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Nov    

Archives

RSS

RSS Feed RSS - Posts

RSS Feed RSS - Comments

Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • mukesh notes
    • Already have a WordPress.com account? Log in now.
    • mukesh notes
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...
 

You must be logged in to post a comment.