We're having issues installing the Az and Az.ResourceGraph Powershell modules for the FlexNet Beacon's Azure connector.
We're unable to install these modules with the Powershell Install-Module command, or are having issues when trying to.
We have already confirmed our .NET version is up to date, and our Beacon is upgraded to the required version, according to the pre-requisites section of the Azure connector document: (https://docs.flexera.com/fnms/EN/WebHelp/index.html#tasks/IB-ConnectAzure.html)
Installing Az is possible via an MSI installer, available on Microsoft's own github:
https://github.com/Azure/azure-powershell/releases
Ensure you download a compatible version of Az's Gallery Module - version 6.1.0 or later.
Scroll down to the Assets section, and choose the MSI installer for your architecture (usually x64).
This can then be copied onto your Beacon and installed.
You may need to remove an installation of AzureRm if you've used an older Azure connector in the past.
This is covered in step 1 of the Azure connector document above.
Az and all of its' underlying modules should be visible in Powershell if you run:
Get-InstalledModule
On a device with internet access, download the Az.ResourceGraph Powershell module from PSGallery.
The first supported version, 0.11.0, can be found here:
https://www.powershellgallery.com/packages/Az.ResourceGraph/0.11.0
Under 'Installation Options' choose Manual Download.
This will download a .nupkg file.
Extract this using a file compression program like 7Zip.
The contents should look similar to the following:
Remove the NuGet-specific files from this folder:
_rels, package, [Content_Types].xml and <name>.nuspec files
These are not used when manually importing the Powershell module.
Your extracted folder should look like this:
Rename your folder.
The extracted folder will be called az.resourcegraph.0.11.0.
Rename this to Az.ResourceGraph
Paste the entire folder into
%ProgramFiles%\WindowsPowerShell\Modules
This Powershell module will not appear in Get-InstalledModule.
This will still be utilised by the Azure adapter successfully.
The underlying DLLs and Powershell files can be blocked by Windows.
"ERROR: System.Management.Automation.CmdletInvocationException: Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\Az.ResourceGraph\Microsoft.Azure.Management.ResourceGraph.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ---> System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\Az.ResourceGraph\Microsoft.Azure.Management.ResourceGraph.dll' or one of its dependencies."
If running the connector fails with the above error, try right-clicking and Unblocking the files we've placed in %ProgramFiles%\WindowsPowershell\Modules\Az.ResourceGraph\
References
"Install Azure PowerShell on Windows with MSI", Last Visited 15/02/2022
https://docs.microsoft.com/en-us/powershell/azure/install-az-ps-msi?view=azps-6.5.0
"Manual Package Download", Last Visited 15/02/2022
Apr 13, 2022 09:32 AM