Open Markarend opened 3 years ago
This absolutely used to work on 4.16.0.4 using either uploading the module with and importing it manually or setting it in requirements, I have a bunch of scripts that were working at the end of October but now fail with ERROR: Assembly with same name is already loadedException
Ive gone back to 4.5.1.1 and got the scripts working again but this isnt ideal
Can you show how to load a specific, required version of MSAL.PS to an Azure Function App? Methods tried:
In requirements.psd1, add the line: 'MSAL.PS' = '4.5.1.1' telling Azure to load this as a managed dependency. This works but has another problem: Azure will only load managed dependencies that don't require license acceptance, so 4.5.1.1 is the last such version that can be loaded this way. I need fixes that were added after 4.5.1.1.
Or, in the script, add lines:
Install-Module -Name 'MSAL.PS' -RequiredVersion '4.16.0.4' -AcceptLicense -Force Import-Module -Name 'MSAL.PS' -RequiredVersion '4.16.0.4'
First run: 2020-11-04T17:21:10.208 [Information] INFORMATION: Install-Module MSAL.PS -RequiredVersion 4.16.0.4 -AcceptLicense -Force 2020-11-04T17:21:33.952 [Warning] WARNING: User declined to install module (MSAL.PS). Why would "user declined" occur if I used -AcceptLicense?
Second run: System.IO.FileLoadExceptionMessage : Assembly with same name is already loaded ... Import-ModuleCommandOrigin : InternalScriptStackTrace : at,
D:\local\UserProfile\Documents\PowerShell\Modules\MSAL.PS\4.16.0.4\MSAL.PS.ps1: line 20 at ,
D:\local\UserProfile\Documents\PowerShell\Modules\MSAL.PS\4.16.0.4\MSAL.PS.psm1: line 17
This "already loaded" error is supposed to be fixed in 4.16.0.4, however, in this version, line 20 has had no fix applied: Add-Type -LiteralPath $RequiredAssemblies | Out-Null
There must be a way to load a version to an Azure Function App that requires license acceptance, do you know it?
Thanks, Mark Arend