Azure / Azure/azure-cli

Enable authentication via environment variables

Open
#10,241 19 comments 84 reactions 2 assignees Claimed by @isra-fel View on GitHub
Account act-identity-squad customer-reported Feature Candidate feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Is your feature request related to a problem? Please describe.**
I'm concerned that I cannot use the CLI without having my credentials written to disk in the clear.

**Describe the solution you'd like**
I would like the CLI to accept credentials from the environment (e.g. `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`).

**Describe alternatives you've considered**
I've yet to find a way to authenticate that doesn't involve secrets being written to `~/.azure`.

**Additional context**
I came across [this](https://github.com/Azure/azure-cli/issues/9282) issue which seems to describe the same thing, but was closed following an apparent misunderstanding. While the AWS CLI does indeed write secrets in the clear to disk when configured via `aws configure`, it also allows for [configuration via environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html).

I've also found examples in both the Ruby SDK [here](https://github.com/Azure/azure-sdk-for-ruby#option-1---environment-variables), and the Go SDK [here](https://github.com/Azure/azure-sdk-for-go#more-authentication-details) where authentication via environment variables is enabled.

This issue is particularly problematic in a dockerized environment where it's common for the home directory to be mapped on the host.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.