Solved

Azure - UNKNOWN: Command error: ERROR: User 'xyz' does not exist in MSAL token cache. Run `az login`.


Userlevel 1
Badge +8

Hi,

I run az-login again. ALL fine.

 

Azure login works.

I run the Command from the Command Line = Works

/usr/lib/centreon/plugins/centreon_azure_network_networkinterface_api.pl --plugin=cloud::azure::network::networkinterface::plugin --mode=traffic ……

OK: Resource 'cpaze-sftp01635' total BytesReceivedRate: 786.03KB, BytesSentRate: 1.63MB,

 

In The Web Interface:

UNKNOWN: Command error: ERROR: User  'xyz' does not exist in MSAL token cache. Run `az login`.

 

Thanks

Andreas

 

icon

Best answer by itoussies 9 May 2022, 17:33

View original

6 replies

Userlevel 3
Badge +9

Hello @ahartung,

 

Does the command work with the centreon-engine user ? If it doesn’t, what are the rights of the /var/lib/centreon-engine/.azure/accessTokens.json file? 

 

Regards,

Userlevel 1
Badge +8

Hi,

 

with centreon-engine user:

UNKNOWN: Command error: ERROR: User  'xyz' does not exist in MSAL token cache. Run `az login`.

 

/var/lib/centreon-engine/.azure/accessTokens.json  = Rights ( 0664 )

 
Userlevel 3
Badge +9

Oops sorry, I meant who is the owner of the file ? It should be the centreon-engine user and the rights should look like that 

-rw-------. 1 centreon-engine centreon-engine

 

Regards

Userlevel 1
Badge +8

I found the issue.

azure-cli Version > 2.30 !!

after downgrad the azure-cli - Works

 

https://docs.microsoft.com/en-us/cli/azure/msal-based-azure-cli

 

😁

Userlevel 1
Badge +8

Latest versions of Azure CLI use MSAL and no longer generate accessTokens.json.

Any existing workflow depending on accessTokens.json no longer works.

Userlevel 3
Badge +9

Yes we recommend using azure-cli-2.29 IF you really want to use Azure CLI. Otherwise, we recommend using the API. 

 

More information on the dedicated page https://docs.centreon.com/pp/integrations/plugin-packs/getting-started/how-to-guides/azure-credential-configuration/#azure-cli-setup.

Reply