I am implementing MSAL.NET on my asp.net core api.
Below is my example code. It works perfectly fine when I run it on my local machine. The login from MSAL popups.
var app = PublicClientApplicationBuilder.Create(clientId)
.WithDefaultRedirectUri()
.WithTenantId(tenantId)
.Build();
var result = await app.AcquireTokenInteractive(scopes).ExecuteAsync();
When I deploy it on Azure Virtual Machine. The Login from MSAL doesn't popup and it will always in pending state. I check the event logs and it gives me this error logs below:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{3480A401-BDE9-4407-BC02-798A866A****}
and APPID
{30AD8C8E-AE85-42FA-B9E8-7E99E3DF****}
to the user IIS APPPOOL\DefaultAppPool SID (S-1-5-82-3713467212-4047885013-3661040889-683609825-2140) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
Any idea what should I do?