Azure / Azure/azure-cli

az storage copy doesn't hide credentials warning

Open
#16,063 3 comments 5 reactions 1 assignee Assigned to @evelyn-ys View on GitHub
act-codegen-extensibility-squad feature-request Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**

`az storage copy` command: no way to hide credentials warning when using AD authentication.

**To Reproduce**

`az storage copy` to/from a blob without key or sas displays the following warning:
```
There are no credentials provided in your command and environment, we will query for the account key inside your storage account.
Please provide --connection-string, --account-key or --sas-token as credentials, or use `--auth-mode login` if you have required RBAC roles in your command. For more information about RBAC roles in storage, visit https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli.
Setting the corresponding environment variables can avoid inputting credentials in your command. Please use --help to get more information.
```
The `--auth-mode login` mentioned in the warning causes `UnrecognizedArgumentError: unrecognized arguments: --auth-mode login`. `AZURE_STORAGE_AUTH_MODE=login` environment variable has no effect.

**Expected behavior**

Both the `--auth-mode login` and `AZURE_STORAGE_AUTH_MODE=login` hide the annoying message from the command.

**Environment summary**

WSL2/Ubuntu/apt install/bash

**Additional context**

```
azure-cli 2.15.1

core 2.15.1
telemetry 1.0.6

Python location '/opt/az/bin/python3'
Extensions directory '/home/***/.azure/cliextensions'

Python (Linux) 3.6.10 (default, Nov 20 2020, 07:19:13)
[GCC 7.5.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
```

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.