Thanks for asking question! Could you please confirm that you have make the certificate accessible.
Check on this documentation https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate-in-code#make-the-certificate-accessible
Also, if you were able to successfully bind the certificate to the custom domain.
The possible reason for this could be that the code block that you are applying on your appsettings.json it’s trying to get a certificate directly from the root of your web application since you are searching for the path “currentUser”.
For the code block to work you need to get the certificate imported to following root path of your web application:
• PS D:\home> dir cert:\currentuser\my
• PS D:\home> dir cert:\localmachine\my
You can import this certificate using the Kudu site. To access Kudu Navigate to App Service > Advanced Tools > Click on Go.
Also, Just to clarify if you already have the custom domain bound to a SSL certificate on the portal and the appsettings.json is interfering with the portal configuration. The recommendation here is to remove the code block from the appsettings.json and let the portal manage the site certificate.
You may refer to below document link might be helpful:
- https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate-in-code#load-the-certificate-in-code
- https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-3.0#deploy-to-production
- https://learn.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.1#50030-in-process-startup-failure
Please let us know if issue persists.