The az keyvault certificate show changes the foreground and background console text colors when the requested certificate is not found, but does not revert the colors when the command is complete.
The color change remains in place until $Host.UI.RawUI.ForegroundColor/$Host.UI.RawUI.BackgroundColor is manually reset, or until a new session/host process is created.
Install Method:
MSI
CLI version:
azure-cli (2.0.30)
acr (2.0.22)
acs (2.0.30)
advisor (0.5.0)
appservice (0.1.30)
backup (1.1.0)
batch (3.1.11)
batchai (0.1.6)
billing (0.1.7)
cdn (0.0.13)
cloud (2.0.12)
cognitiveservices (0.1.11)
command-modules-nspkg (2.0.1)
configure (2.0.14)
consumption (0.2.2)
container (0.1.20)
core (2.0.30)
cosmosdb (0.1.19)
dla (0.0.18)
dls (0.0.20)
eventgrid (0.1.11)
eventhubs (0.1.1)
extension (0.0.11)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.18)
iot (0.1.18)
keyvault (2.0.20)
lab (0.0.20)
monitor (0.1.4)
network (2.0.26)
nspkg (3.0.2)
profile (2.0.21)
rdbms (0.2.0)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.26)
role (2.0.21)
servicebus (0.1.1)
servicefabric (0.0.11)
sql (2.0.24)
storage (2.0.30)
vm (2.0.29)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\USER_NAME\.azure\cliextensions'
Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
OS version:
Windows 10 v1709, Build 16299.309
Shell Type:
powershell.exe
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      16299  251     
                        I have seen something like this happen inconsistently in CMD as well.
Any updates? This issue is from a year ago and is currently still a problem in the latest version of az cli in combination with Powershell
@jiasli please take a look and comment.
This is a PowerShell issue. Issue created: https://github.com/PowerShell/PowerShell/issues/10729
This also happens in cmd, which is a colorama issue https://github.com/tartley/colorama/issues/200. Root cause provided by https://github.com/tartley/colorama/issues/200#issuecomment-476104215.
Can this issue be left open until the colorama issue is resolved, or until the az cli provides a mitigation? My team encounters this issue almost daily, and it makes the product seem unprofessional. Even if the root cause belongs to another product, the az cli owns some responsibility by selecting the dependency. I would accept an option to disable colors altogether. As it stands I am considering wrapping my PowerShell functions which use the az cli in try/finally blocks to ensure the terminal colors revert to their original values.
Hi @abarger-bss, sure we can reopen this issue. I have created an issue in Knack to allow disabling color. I will work on this to disable colored output.
Hi @abarger-bss, actually even pip is affected by this issue https://github.com/pypa/pip/issues/6354. Given the condition that there is no better python lib for coloring, I have created PR https://github.com/microsoft/knack/pull/171 to allow disabling color.
Just adding that for me, this happens regardless of the command, but any time there is a failure or a warning, all the output from then on turns either red or yellow, including the prompt.
This issue can be solved after PR https://github.com/Azure/azure-cli/pull/12604 is merged. We are planing to include the change in this release.
Most helpful comment
Hi @abarger-bss, actually even pip is affected by this issue https://github.com/pypa/pip/issues/6354. Given the condition that there is no better python lib for coloring, I have created PR https://github.com/microsoft/knack/pull/171 to allow disabling color.