Friday, September 4, 2020

How to Login to AWS using CLI with AzureSSO through Azure Active Directory

Testing on Windows 10 Release 1909 

Prerequisite (Install Visual Studio Code and the AWS CLI if you don't have it already installed and your Azure Active Directory is already configured and processing authentication)

1. Install Node.Js

(Use the LTS Edition/Version)

2. Check the node version in PowerShell or Windows Terminal:

node --version && npm --version

3. npm install -g aws-azure-login

*install will take about 15-20 minutes. Be patient and let it finish. 

4. Configure your profile

aws-azure-login --configure --profile=<<Name of your profile>>


aws-azure-login --configure --profile=migrationking

Pro Tip: It installs the profile on your machine under ~/.aws/config . You can edit the file with Visual Studio Code or Notepad++

#This will prompt to Enter the Azure AD details

*** Azure Tenant ID: << Enter the Azure AD Tenant ID from the Azure AD application configuration for the AWS Account to be accessed>> Azure Tenant ID URL:

*** Azure App ID URI:  << Replace this with Azure App ID identifier from App Config>> Find it via the direct url:

*** Default Username: << Replace this with your complete Azure AD Email Address FQDN (e.g.>>

*** Stay logged in: skip authentication while refreshing aws credentials (true|false) (false) << Type in false>>

*** Default Role ARN (if multiple): <<Hit Return Key, the CLI will fetch the list of role ARN's when trying to login post configuration>>.

*** Default Session Duration Hours (up to 12): (1)

Profile saved.

If your using GovCloud make sure that you identify the region inside of your ~/.aws/config file



cat ~/.aws/config

[profile migrationking]







5. If you want to login without a GUI prompt type

aws-azure-login --profile migrationking --no-sandbox --no-prompt

6. If you want to see the gui or your chasing errors

aws-azure-login --profile migrationking --no-sandbox --no-prompt --mode=gui


Correction Example:



Post a Comment