This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Import-module fails with error on System.ServiceModel.Primitives in Azure

Hello all,

I am using Azure Functions with managedDependency setup in requirements.psd1 to use specific PS module versions.

It was working properly, when I configured required module to be 'SwisPowerShell' = ''. All the module commands worked properly in scripts behind for months.

But as soon as I recently updated the version to be 'SwisPowerShell' = '', the PS scripts fail to import-module with error:

{Could not load file or assembly 'System.ServiceModel.Primitives, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (0x80131621)}


I returned back the previous version and scripts are working properly again.

What was changed in latest release, that the import-module in Azure environment no longer works?

Do you have any suggestions how to fix the error?

Thank you

Note: Azure Functions run on Windows OS, PowerShell Core Version 7.2, 64bit, runtime version ~4