Error:
Publishing a new Blazor app with Identity to Azure App Service giving the following error:
HTTP ERROR 500
Fix:
Steps:
- Windows PowerShell (Admin mode)
PS C:\WINDOWS\system32> New-SelfSignedCertificate -Subject "CN=MyAppCert" -CertStoreLocation "cert:\LocalMachine\My"
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\My
Thumbprint Subject
---------- -------
A123ABBBAB3FA6514806D32D618541B55CC93333 CN=MyAppCert
- Manage computer certificates
- Certificates – Local Computer -> Personal -> Certificates
- Right click on certificate -> Export
- Enable Password and select “TripleDES-SHA1”
- Upload pfx file to Azure App Service
- Get Thumbprint and Subject Name
Thumbprint: A123ABBBAB3FA6514806D32D618541B55CC93333
Subject Name: MyAppCert
- New Configuration in Azure App Service
Name: WEBSITE_LOAD_CERTIFICATES
Value: A123ABBBAB3FA6514806D32D618541B55CC93333
- Add to appsettings.json
"Key": {
"Type": "Store",
"StoreName": "My",
"StoreLocation": "CurrentUser",
"Name": "CN=MyAppCert"
}
Comments