Monitoring and maintaining apps in production
1. Monitoring and maintaining apps in production
Welcome back! Our retail app is live, but something isn't right.2. The challenge
Customers report that orders sometimes disappear without a status update. For a business, even a few missing orders means lost revenue and damaged trust. To protect the customer experience, we need to detect problems early and resolve them fast.3. Why monitoring matters
In modern cloud systems, failures don't always crash the app - they often show up as slow responses, hidden exceptions, or intermittent issues. Without monitoring, developers are left guessing. Monitoring provides visibility into the system, showing when requests fail, how long they take, and where they break down. This is the foundation for reliable services.4. Application Insights in action
Azure's Application Insights collects telemetry automatically from both Web Apps and Functions. It records request traces, performance data, logs, and even dependencies like database calls. With a single view, we can follow a request as it travels from the Web App front-end into the Function back-end. This level of tracing is invaluable for troubleshooting real business flows.5. Detecting the issue
We simulate a customer submitting an order. The Web App confirms the request, but nothing lands in storage. Opening Application Insights, we follow the transaction trace. The Web App looks fine, but the Function shows failures. The logs reveal an exception - the Function fails when parsing the order payload. Without monitoring, this error would stay hidden until customers complained.6. Root cause analysis
In this case, the problem comes from buggy code in the Function. But such failures could also result from malformed input, expired secrets, or missing configuration. The key lesson is that Application Insights makes root causes visible quickly, turning mystery failures into actionable fixes.7. Fixing with new code
With the root cause identified, we fix the bug directly in the Function's code. In the Azure Portal, we update the function logic, save, and redeploy. This is the fastest way to restore service - but it's also risky, because changes happen in production immediately. In a real development team, this method might be used only for urgent fixes.8. Confirming the fix
We re-run the order flow. This time, Application Insights shows a clean trace: the Web App request reaches the Function, executes successfully, and writes the order to storage. Customers can now place orders again, and the system is back online. But we've learned an important lesson - while direct edits solve the problem fast, safer options exist for long-term improvements.9. Let's practice!
Now test it yourself - run the order flow, investigate and fix possible failures in Application Insights.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.