Azure Function v4 and PnP Core and Microsoft Entra authenication to Azure Government

Dave Murphy 0 Reputation points
2024-02-27T21:11:27.9733333+00:00

How do I get this PnP Core sample https://github.com/pnp/pnpcore/tree/dev/samples/Demo.AzureFunction.OutOfProcess.AppOnly to authenticate to a Government Cloud using Integrate Microsoft Entra authentication with Web Apps on Azure Government ?

The PnP Core sample is a v4 Azure Function but the Microsoft docs are for an earlier version.

I've added "Authentication": { "AzureAd": { "Azure ADInstance": "https://login.microsoftonline.us/", "CallbackPath": "/signin-oidc", "ClientId": "<clientid>", "Domain": "<domainname>", "TenantId": "<tenantid>" } } to the local.settings.json because the appsettings.json does not exist.

Then I added the ConfigureServices method to the Program.cs since the startup.cs doesn't exist.

The services.AddAuthentication is not valid and I can't figure out how to incorporate it into var host = new HostBuilder()

Thanks for any guidance or examples.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,887 questions
{count} votes

Your answer

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