Skip to main content

Ajout package nuggets

image.png

Ajout des services

Ajouter dans Program.cs

builder.Services.AddSingleton<PortalClient>();
builder.Services.AddHttpClient(PortalClient.ClientName);
builder.Services.Configure<PortalOptions>(builder.Configuration.GetSection(PortalOptions.ConfigurationSection));

Ajouter les appsettings

"Portal": {
"HostName": "cam-dataportal-api.azurewebsites.net",
//"PortNumber": 5001,
"Scope": "api://xxx/.default"
}

Vérifier d'avoir l'authentification Azure

Dans les nuggets image.png

Dans Program.cs

builder.Services.AddMicrosoftIdentityWebApiAuthentication(builder.Configuration);

Dans l'appseting

"AzureAd": {
"Instance": "https://login.microsoftonline.com",
"TenantId": "xxx",
"ClientId": "xxx"
},

"MICROSOFT_PROVIDER_AUTHENTICATION_SECRET": "xxx",