Chapter 5: Observability
Activity 5: Identifying an Issue with Your Serverless Architecture
Deploy the ProductsApi function app provided in the Activity 5 folder and modify the connection string in the index.html file to connect to the ProductsApi function app. Ensure that it has the Application Insights identifier on it, as shown here:

Figure 5.17: Modify the connection string
Open the Application Insights instance and navigate to the search tab. There will be a Severity level: Error log saying that the database is unavailable:

Figure 5.18: Application Insights showing the database is unavailable
Open the GetProducst.cs file in the ProductsApi folder supplied in the Activity 5 folder. There is a section of code that throws an exception at random:

Figure 5.19: Erroneous code
Remove this piece of code that is throwing the errors and deploy it. You will now no longer get issues logged to App Insights. Your repaired code should look as follows:

Figure 5.20: Repaired code