I'd expect this to work without the need to relog.
Issue script & Debug output
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
Also, I have additional question - how is this implemented? I get a secret warning on one event hub resource, but I don't get this on another. The request is using the same API version.
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
Environment data
Module versions
Error output
No response