question

TanmoyDas-9282 avatar image
0 Votes"
TanmoyDas-9282 asked MikeUrnun commented

pnp.powershell error in Azure function app - PowerShell

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TanmoyDas-9282 avatar image
0 Votes"
TanmoyDas-9282 answered MikeUrnun commented

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

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi anonymous user - Glad to hear that you're unblocked and thank you for sharing what worked for you to fix the issue, surely, it'll benefit others visiting this post in the future.

0 Votes 0 ·