Azure / Azure/azure-powershell

Setting AZURE_CLIENTS_SHOW_SECRETS_WARNING env var doesn't disable secrets warning

Open
#25,001 1 comment 0 reactions 0 assignees View on GitHub
bug customer-reported needs-triage
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

According to https://learn.microsoft.com/en-us/powershell/azure/protect-secrets?view=azps-12.0.0#disable-the-warning-message setting env var AZURE_CLIENTS_SHOW_SECRETS_WARNING should disable secrets warning. This doesn't seem to work unless user uses Connect-AzAccount.

I'd expect this to work without the need to relog.

### Issue script & Debug output

```PowerShell
Get-AzEventHubKey ...
...
WARNING: The output of cmdlet Get-AzEventHubKey may compromise security by showing the following secrets:
PrimaryConnectionString, PrimaryKey, SecondaryConnectionString, SecondaryKey. Learn more at
https://go.microsoft.com/fwlink/?linkid=2258844
Set-Item -Path Env:\AZURE_CLIENTS_SHOW_SECRETS_WARNING -Value $false
Get-AzEventHubKey ...
...
WARNING: The output of cmdlet Get-AzEventHubKey may compromise security by showing the following secrets:
PrimaryConnectionString, PrimaryKey, SecondaryConnectionString, SecondaryKey. Learn more at
https://go.microsoft.com/fwlink/?linkid=2258844
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 5.1.19041.4412
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.4412
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 3.0.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear...
Script 5.0.0 Az.EventHub
```

### Error output

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported behavior with Get-AzEventHubKey after setting AZURE_CLIENTS_SHOW_SECRETS_WARNING, both before and after Connect-AzAccount. Start by tracing the warning behavior across the Az.EventHub and Az.Accounts entry points; done means the environment variable suppresses the warning without requiring a new login.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.