0
votes

I need to use the azure cli from within a linux virtual machine. There are two contraints:

  1. cannot use/store the credentials used for creating the VM on the VM.
  2. the login/authentication need to be automated (non-interactive)

On AWS, I can use instance profiles for such scenario, but I am unable to find any feasible approach for Azure. Any help is greatly appreciated.

2

2 Answers

1
votes

If you are using Azure CLI 2.0, you can use az login with the --msi parameter to log in using the Virtual Machine's identity. See the az login documentation for more information.

0
votes

az login —msi has been deprecated (See here) as of v2.0.22.

The new method is to use the —identity option. ie. az login —identity. See az login docs for more information.