Azurerm 3.0.0 not taking service principal auth from but only from env varible set

I am providing in client_secret and all details but terraform init is always picking from az cli auth if I do azz logout terrform through az cli error

: Error building ARM Config: please ensure you have installed Azure CLI version 2.0.79 or newer. Error parsing json result from the Azure CLI: waiting for the Azure CLI: signal: interrupt: Traceback (most recent call last):
│ File “/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/”, line 187, in _run_module_as_main

but when I set AZURERM_CLIENT_SECRET it works fine.