Skip to main content
Solved

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

  • May 9, 2022
  • 6 replies
  • 1747 views

Forum|alt.badge.img+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

 

Best answer by itoussies

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.

6 replies

itoussies
Centreonian
Forum|alt.badge.img+11
  • Centreonian
  • May 9, 2022

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,


Forum|alt.badge.img+8
  • Author
  • Builder *
  • May 9, 2022

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 )

 

itoussies
Centreonian
Forum|alt.badge.img+11
  • Centreonian
  • May 9, 2022

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


Forum|alt.badge.img+8
  • Author
  • Builder *
  • May 9, 2022

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

 

😁


Forum|alt.badge.img+8
  • Author
  • Builder *
  • May 9, 2022

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

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


itoussies
Centreonian
Forum|alt.badge.img+11
  • Centreonian
  • Answer
  • May 9, 2022

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.