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=1.14.0.0, 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=4.38.0.0, 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:
<?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" /> <bindingRedirect oldVersion="1.20.0.0" newVersion="1.21.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" /> <bindingRedirect oldVersion="4.30.0.0" newVersion="4.30.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Azure.Identity" publicKeyToken="92742159e12e44c8" culture="neutral" /> <bindingRedirect oldVersion="1.4.0.0" newVersion="1.5.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="4.0.2.0" newVersion="4.0.3.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
The exact assembly details to specify (including the list of assemblies, and the publicKeyToken and version details) may vary based on the component versions that you have installed.
See the following page for information about installing PowerShell module prerequisites for the Azure connector: Microsoft Azure Connector > Prerequisites and Setting Up.
This issue is still open but not currently scheduled to be addressed.
Affected components: Integration: Azure, Inventory import (read/write/export)
Master issue ID: IOK-991576
Also known as: ITAM-421
Oct 10, 2022 02:37 AM - edited Nov 20, 2023 01:33 PM