Share via

pnp.powershell error in Azure function app - PowerShell

Tanmoy Das 806 Reputation points
2021-04-28T07:46:32.427+00:00

Hi,

I have an azure function app powershell, I am trying to use pnp.powershell module.
I have added the module in Module's folder in the Kudu site.
But when running it from my script getting the error. The dll (System.IdentityModel.Tokens.Jwt) file is there in the core and framework folder. Any idea?

WARNING:A newer version of PnP PowerShell is available: 1.5.0.Use 'Update-Module -Name PnP.PowerShell' to update.You can turn this check off by setting the 'PNPPOWERSHELL_UPDATECHECK' environment variable to 'Off'
2021-04-28T06:02:37.376 [Error] ERROR: Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)Exception :Type : System.IO.FileLoadExceptionMessage : Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)FileName : System.IdentityModel.Tokens.Jwt, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35TargetSite :Name : ProcessRecordDeclaringType : PnP.PowerShell.Commands.Base.ConnectOnlineMemberType : MethodModule : PnP.PowerShell.dllStackTrace :at PnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord()

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments

Answer accepted by question author

Tanmoy Das 806 Reputation points
2021-04-29T13:42:21.107+00:00

In the requirement.psd1 added pnp.Powershell = 1.* fixed the issue

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.