Logging and Backups in Azure App Service
Learn about logging and backup, the key features of Azure App Service.
We'll cover the following...
Now that we have some knowledge of Azure web apps, it’s time to get familiar with its key features. You can see the sample code below that just prints statements over the console. Let’s discuss its use cases and why we should consider it.
using System;class AzureCloud{static void Main(){try{System.Console.WriteLine("Hello, Cloud Engineers !!");int x= 10/0;}catch(Exception ex){System.Console.WriteLine(ex.ToString());}}}
Our primary focus here is on exception handling. You can see the exception is printed on the screen using the Console.Writeline()
statements in C#. We can log this exception so that we can track what the issue is so we can fix it later on.
This is useful for applications used by large enterprises to find
Azure App Service logging
Let’s say we deployed the code, and it crashed in production. For scenarios like this, we log exceptions. But what if our application doesn’t boot up? Then what?
Azure App Service offers a service called App Service logs. Once we enable this service, every time a request is made on our app’s endpoint, it will show us what’s happening behind the scenes. This way, we can figure out why the app is crashing.
Let’s look at the steps on how to enable this service:
-
Open your deployed web ...