Help with authentication issue #1298
Replies: 2 comments
-
@ajcaterino : can you try to also add a site and connect the site to see if that makes a difference (see line 37-41 and 61-64 from https://github.com/pnp/pnpcore/blob/dev/samples/Demo.AzureFunction.OutOfProcess.AppOnly/Program.cs) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I ended up changing the Startup.cs to the following and this fixed my issue:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a V4 Azure Function trying to use Username and Password authentication. I have copied the code from one of our existing applications that successfully uses the authentication method. I am using all the latest versions PnP.Core, PnP.Core.Auth, PnP.Core.Admin, and PnP.Framework.
In my StartUp.cs I have the following code:
When I step through the StartUp code I can see that Username and Password are the correct values. In my other code I have the following constructor and method:
When the code tries to get the implementation of IPnPContextFactory from dependency injection, I get the following error:
System.Private.CoreLib: Exception while executing function: TaxBatchProcessing. System.Private.CoreLib: One or more errors occurred. (Exception has been thrown by the target of an invocation.). System.Private.CoreLib: Exception has been thrown by the target of an invocation. PnP.Core.Auth: Invalid or missing value for Username in UsernamePasswordAuthenticationProvider configuration.
As I stated, this works fine in another application. The only difference between the 2 applications is that the one I am having problems with is an Azure Function and the other that works is an Azure App Service. Any suggestions to fix this would be appreciation as I'm not sure where to go from here.
Beta Was this translation helpful? Give feedback.
All reactions