The inventory import process may fail at the “Get Azure VM Instances” step of the Azure readers due to version mismatches between the modules rolled up in to the Azure Az PowerShell module and dependent Microsoft assembly versions.
When this issue occurs, the import process fails with logging similar to:
2022-03-28 12:22:57,178 [INFO ] Get Azure VM Instances (Transfer data from source 'AzureTest' to FNMP)
2022-03-28 12:22:57,568 [INFO ] #ObjectModel_CloudServiceInstance_GetAzureVMInstances
2022-03-28 12:22:57,615 [WARN ] Warning! The maximum key length is 900 bytes. The index 'CK_#ObjectModel_CloudServiceInstance_GetAzureVMInstances' has maximum length of 1824 bytes. For some combination of large values, the insert/update operation will fail.
2022-03-28 12:23:14,729 [INFO ] Failed to execute Reader 'Get Azure VM Instances' from file C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Reader\microsoft azure\Instance.xml, at step line 1
Error: Please review the error message and correct the issue, then try again:
Could not load file or assembly 'Azure.Core, Version=184.108.40.206, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies. The system cannot find the file specified.
Another example of an error message associated with this issue is:
Error: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Could not load file or assembly 'Microsoft.Identity.Client, Version=220.127.116.11, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' or one of its dependencies. The system cannot find the file specified.
The exact assembly name, Version and PublicKeyToken details may vary based on exact component versions that are installed.
Add content like the following to C:\Program Files (x86)\Flexera Software\FlexNet Manager Platform\DotNet\bin\ComplianceReader.exe.config to redirect the import process to use installed assembly versions: