The other day I was working with a developer friend (I know right… who knew developers had friends?) when we discussed moving his test app into my Azure Cloud. As this was a whistle-stop tour I didn’t have my MacBook with me…
Thankfully his workstation ran Docker, which was just enough of what I needed.
Inside your Linux host, run Docker using:
docker run -d -it microsoft/azure-cli
Attach to the container by specifying the ID (substitute accordingly):
docker attach dcfd1a824d70
Once inside the container, login to Azure using:
This will ask you to browse to https://aka.ms/devicelogin and enter a code. Once you have done that the CLI will authenticate you and grant you access. Pretty cool huh?
Alternatively you can login with a simple username and password using the following (substitute accordingly):
azure login -u firstname.lastname@example.org
It will then prompt you for a password.
As with with Azure PowerShell module, you can use a publish settings file with the CLI. To do this, once logged in use:
azure account download
This opens your default browser and prompts you to sign in to the Azure classic portal. After you sign in, a .publishsettings file downloads. Make note of where this file is saved. You can import the file using:
azure account import publishsettings file
Make sure to delete the file after it has been imported.
Once connected to Azure, you can view your subscription using:
azure account list
azure account show
Once authenticated I then went on to create a resource group with ARM and migrate my friend’s workload. More on this to follow!