There might be a scenario where you see an error “An unexpected error has occurred!” on the screen when trying to view the website, after deployment.
To resolve it, follow these steps:
- Go to Azure portal and search for the resource group created for the deployment.
- Under resource group, select the App Service resource for the deployment.
- Click on the Application Settings in the App Service resource.
- Under App settings section of the Application Settigns page, make sure all the parameters present in the parameters.json file are successfully copied, along with their correct values, to the App settings section.
- If there is a missing parameter, add that parameter and click on Save.
- If the value of a parameter is incorrect, make sure to correct that value and click on Save.
- Browse the URL for the website (or refresh the website page).
- If the error persists, follow Step 2
Step 2 (To be followed only if Step 1 fails)
- Browse to https://<XYZ>.scm.azurewebsites.net, where https://<XYZ>.azurewebsites.net is the URL for the deployed website.
- Under Debug console section, select PowerShell
- In the list, select site
- Select wwwroot in the list.
- Click on the edit option adjacent to Web.config
- Search for this line in the file:
And change it to,<customErrors mode=”Off” />
Click on the Save button.
- Refresh the website. You should be able to see the complete error now. Take a screenshot and send it to email@example.com for further investigation.